removeAll method

  1. @override
Iterable<E> removeAll()

Removes all the elements from this queue and returns them.

The returned iterable has no specified order. The operation does not copy the elements, but instead keeps them in the existing heap structure, and iterates over that directly.


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