Spec-Zone.ru › Dart 2

dart:collection

Метод remove

bool remove(
  1. Object? o
)
override

Удаляет единственный экземпляр value из очереди.

Возвращает true если значение было удалено, или false если в очереди не было элемента, равного value.

Реализация

bool remove(Object? o) {
  _DoubleLinkedQueueEntry<E> entry = _sentinel._nextLink!;
  while (true) {
    var elementEntry = entry._asNonSentinelEntry();
    if (elementEntry == null) return false;
    bool equals = (elementEntry.element == o);
    if (!identical(this, elementEntry._queue)) {
      // Entry must still be in the queue.
      throw ConcurrentModificationError(this);
    }
    if (equals) {
      entry._remove();
      _elementCount--;
      return true;
    }
    entry = entry._nextLink!;
  }
}

© 2012 the Dart project authors
Licensed under the BSD 3-Clause "New" or "Revised" License.
https://api.dart.dev/stable/2.18.5/dart-collection/DoubleLinkedQueue/remove.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API