swap method

void swap(
  1. int i,
  2. int j
)

Swaps two elements in the slice. Will throw if the indices are out of bounds.

Implementation

void swap(int i, int j) {
  var temp = _list[i + _start];
  _list[i + _start] = _list[j + _start];
  _list[j + _start] = temp;
}