detach method

void detach()

Removes this entry from its list. Does nothing if it is detached.

Implementation

void detach() {
  final owner = _owner;
  if (owner == null) return;
  if (_prev case final prev?) {
    prev._next = _next;
  } else {
    owner._first = _next;
  }
  if (_next case final next?) {
    next._prev = _prev;
  } else {
    owner._last = _prev;
  }
  _owner = null;
  _prev = null;
  _next = null;
}