Method RemoveAtSwapBack
RemoveAtSwapBack(int)
Copies the last element of this list to an index. Decrements the length by 1.
Declaration
public void RemoveAtSwapBack(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index | The index to overwrite with the last element. |
Remarks
Useful as a cheap way to remove elements from a list when you don't care about preserving order.
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | Thrown if the index is out of bounds. |