public SortedRangeList(int capacity) { if (capacity > 0) { _list = new GapBuffer <T>(capacity); } else { _list = s_emptyList; } }
public void Insert(int index, T item) { if (item == null) { Debug.Fail("Can't insert a null item"); } else { if (_list == s_emptyList) { _list = new GapBuffer <T>(); } _list.Insert(index, item); ChangeStamp++; OnAdded(index); VerifyInsertedObject(index); } }