removeFirst method

E removeFirst ()
override

Removes and returns the first element of this queue.

The queue must not be empty when this method is called.

Implementation

E removeFirst() {
  if (_head == _tail) throw new StateError("No element");
  E result = _table[_head];
  _table[_head] = null;
  _head = (_head + 1) & (_table.length - 1);
  return result;
}