public void InsertRange(int index, IEnumerable <T> list) { int spaceNeeded = list.Count(); int index2 = _list.Count - index; ListExt.InsertRangeHelper(_list, index2, spaceNeeded); index2 += spaceNeeded; var e = list.GetEnumerator(); while (e.MoveNext()) { _list[--index2] = e.Current; } }
public void InsertRange(int index, IReadOnlyCollection <T> list) { int spaceNeeded = list.Count; int index2 = _list.Count - index; ListExt.InsertRangeHelper(_list, index2, spaceNeeded); index2 += spaceNeeded - 1; var e = list.GetEnumerator(); for (int i = 0; i < spaceNeeded; i++) { G.Verify(e.MoveNext()); _list[index2 - i] = e.Current; } }