reverseRange method

void reverseRange(
  1. int start,
  2. int end
)

Reverses the elements in a range of the list.

Implementation

void reverseRange(int start, int end) {
  RangeError.checkValidRange(start, end, length);
  while (start < --end) {
    var tmp = this[start];
    this[start] = this[end];
    this[end] = tmp;
    start += 1;
  }
}