Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ RemoveRange()

virtual void System.Collections.ArrayList.RemoveRange ( int index,
int count )
inlinevirtual

Reimplemented in System.Collections.ArrayList.IListWrapper, System.Collections.ArrayList.SyncArrayList, System.Collections.ArrayList.FixedSizeArrayList, System.Collections.ArrayList.ReadOnlyArrayList, and System.Collections.ArrayList.Range.

Definition at line 2617 of file ArrayList.cs.

2618 {
2619 if (index < 0)
2620 {
2621 throw new ArgumentOutOfRangeException("index", SR.ArgumentOutOfRange_NeedNonNegNum);
2622 }
2623 if (count < 0)
2624 {
2625 throw new ArgumentOutOfRangeException("count", SR.ArgumentOutOfRange_NeedNonNegNum);
2626 }
2627 if (_size - index < count)
2628 {
2629 throw new ArgumentException(SR.Argument_InvalidOffLen);
2630 }
2631 if (count > 0)
2632 {
2633 int num = _size;
2634 _size -= count;
2635 if (index < _size)
2636 {
2637 Array.Copy(_items, index + count, _items, index, _size - index);
2638 }
2639 while (num > _size)
2640 {
2641 _items[--num] = null;
2642 }
2643 _version++;
2644 }
2645 }

References System.Collections.ArrayList._items, System.Collections.ArrayList._size, System.Collections.ArrayList._version, System.SR.Argument_InvalidOffLen, System.SR.ArgumentOutOfRange_NeedNonNegNum, System.Array.Copy(), System.count, and System.index.

Referenced by System.Collections.ArrayList.Range.Clear(), System.Xml.Xsl.Qil.SubstitutionList.RemoveLastSubstitutionPair(), System.Collections.ArrayList.SyncArrayList.RemoveRange(), and System.Collections.ArrayList.Range.RemoveRange().