MCPcopy Create free account
hub / github.com/argumentcomputer/ix / find_root_key

Method find_root_key

crates/kernel/src/equiv.rs:120–124  ·  view source on GitHub ↗

Find the root representative key for a given composite key. Returns None if the key is not in the union-find. Like `is_equiv`, takes the lookup key by reference so callers can reuse a single `EqKey` binding across multiple queries without cloning it for each call.

(&mut self, key: &EqKey)

Source from the content-addressed store, hash-verified

118 let rb = self.find(b);
119 if ra == rb {
120 return false;
121 }
122 if self.rank[ra] < self.rank[rb] {
123 self.parent[ra] = rb;
124 } else if self.rank[ra] > self.rank[rb] {
125 self.parent[rb] = ra;
126 } else {
127 self.parent[rb] = ra;

Callers 1

is_def_eqMethod · 0.80

Calls 2

getMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected