Пример #1
0
        private void Resize(int capacity)
        {
            count.Set(Math.Min(capacity, count));
            NetArray <T, TField> oldArray = array.Value;
            NetArray <T, TField> newArray = new NetArray <T, TField>(capacity);

            array.Value = newArray;
            for (int i = 0; i < capacity && i < Count; i++)
            {
                T tmp = oldArray[i];
                oldArray[i]    = default(T);
                array.Value[i] = tmp;
            }
        }
Пример #2
0
 public void Clear()
 {
     Counter.Set(0);
     currentCount = 0;
 }