removeLast method Null safety

E removeLast()
override

Removes and returns the last element of the queue.

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

Implementation

E removeLast() {
  if (_head == _tail) throw IterableElementError.noElement();
  _modificationCount++;
  _tail = (_tail - 1) & (_table.length - 1);
  E result = _table[_tail] as E;
  _table[_tail] = null;
  return result;
}