find<T> static method

TreeNode<T>? find<T>(
  1. List<TreeNode<T>> roots,
  2. TreeNodeId id
)

Find a node by id, or null.

Implementation

static TreeNode<T>? find<T>(List<TreeNode<T>> roots, TreeNodeId id) {
  TreeNode<T>? hit;
  walk<T>(roots, (n, _) {
    if (n.id == id) hit = n;
  });
  return hit;
}