document directed union-find lookup in bulk_utils for clarity

This commit is contained in:
Daniel Chalef 2025-09-26 08:06:54 -07:00
parent 51855f91ae
commit de01609540

View file

@ -80,6 +80,7 @@ def _build_directed_uuid_map(pairs: list[tuple[str, str]]) -> dict[str, str]:
parent: dict[str, str] = {}
def find(uuid: str) -> str:
"""Directed union-find lookup using iterative path compression."""
parent.setdefault(uuid, uuid)
root = uuid
while parent[root] != root: