W3cubDocs

/Dart 2

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 IterableElementError.noElement();
  _modificationCount++;
  E result = _table[_head];
  _table[_head] = null;
  _head = (_head + 1) & (_table.length - 1);
  return result;
}

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.5.0/dart-collection/ListQueue/removeFirst.html