pop method

T pop()

Removes the smallest element from the queue and returns it.

Implementation

T pop() {
  final top = data.first;
  final bottom = data.removeLast();

  if (--length > 0) {
    data[0] = bottom;
    _down(0);
  }

  return top;
}