removeAll method

Iterable<E> removeAll ()
override

Removes all the elements from this queue and returns them.

The returned iterable has no specified order.

Implementation

Iterable<E> removeAll() {
  List<E> result = _queue;
  int length = _length;
  _queue = const [];
  _length = 0;
  return result.take(length);
}