void clear()

Remove all elements from this linked list.

Source

void clear() {
  _modificationCount++;
  _LinkedListLink next = _next;
  while (!identical(next, this)) {
    E entry = next;
    next = entry._next;
    entry._next = entry._previous = entry._list = null;
  }
  _next = _previous = this;
  _length = 0;
}