toList method

List<E> toList ()
override

Returns a list of the elements of this queue in priority order.

The queue is not modified.

The order is the order that the elements would be in if they were removed from this queue using removeFirst.

Implementation

List<E> toList() {
  List<E> list = new List<E>()..length = _length;
  list.setRange(0, _length, _queue);
  list.sort(comparison);
  return list;
}