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; } }
public void Clear() { Counter.Set(0); currentCount = 0; }