Method SwapAtIndices
SwapAtIndices<T>(List<T>, int, int)
Swaps the elements at first and second with minimal copying.
Works for any type of List<T>.
Declaration
public static void SwapAtIndices<T>(this List<T> list, int first, int second)
Parameters
| Type | Name | Description |
|---|---|---|
| List<T> | list | The list to perform the swap on. |
| int | first | The index of the first item to swap. |
| int | second | The index of the second item to swap. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of list items to swapped. |