moveToTheEnd method

void moveToTheEnd(
  1. T item
)

Moves the first occurrence of the item to the end of the list.

Implementation

void moveToTheEnd(T item) {
  int pos = indexOf(item);
  if (pos != -1 && pos != length - 1) {
    removeAt(pos);
    add(item);
  }
}