public void InsertRange(int index, IEnumerable <T> collection) { var collectionCount = collection.Count(); Deque <T> .CheckNewIndexArgument(Count, index); if (collectionCount > Capacity - Count) { Capacity = checked (Count + collectionCount); } if (collectionCount == 0) { return; } DoInsertRange(index, collection, collectionCount); }
public void Insert(int index, T item) { Deque <T> .CheckNewIndexArgument(Count, index); DoInsert(index, item); }