cycles method

bool cycles(
  1. Node node
)

True if node is (or soon will be) an ancestor of this node.

Implementation

bool cycles(Node node) {
  Node? current = this;

  while (current != null) {
    if (identical(current, node)) return true;
    current = current._parent ?? current._pendingParent;
  }

  return false;
}