Example #1
0
        public void TestExpandTo()
        {
            FasterList <int> list = new FasterList <int>(0);

            list.ExpandTo(10);

            Assert.That(list.capacity, Is.EqualTo(10));
            Assert.That(list.count, Is.EqualTo(10));
        }
Example #2
0
 void reserve(uint u)
 {
     if (u > capacity_)
     {
         dense.ExpandTo(u);
         sparse.ExpandTo(u);
         capacity_ = u;
     }
 }
Example #3
0
        public void TestSet()
        {
            FasterList <int> list = new FasterList <int>(0);

            list.ExpandTo(10);

            for (int i = 0; i < 10; i++)
            {
                list[i] = i;
            }

            for (int i = 0; i < 10; i++)
            {
                Assert.That(list[i], Is.EqualTo(i));
            }
        }