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

Method is_equiv

crates/kernel/src/equiv.rs:99–112  ·  view source on GitHub ↗

Check if two composite keys are equivalent. Takes keys by reference — callers in the `is_def_eq` hot path already hold `EqKey` tuples as local bindings, and forcing them to pass by value would require an Arc-clone on each component. With by-ref we avoid that clone entirely (see `src/ix/kernel/def_eq.rs` for the caller pattern).

(&mut self, k1: &EqKey, k2: &EqKey)

Source from the content-addressed store, hash-verified

97 }
98 let node = self.parent.len();
99 self.parent.push(node);
100 self.rank.push(0);
101 self.node_to_key.push(key);
102 self.key_to_node.insert(key, node);
103 node
104 }
105
106 /// Find root with path halving (every other node → grandparent).
107 fn find(&mut self, mut node: usize) -> usize {
108 while self.parent[node] != node {
109 self.parent[node] = self.parent[self.parent[node]];
110 node = self.parent[node];
111 }
112 node
113 }
114
115 /// Union by rank. Returns true if sets were different.

Callers 1

is_def_eqMethod · 0.80

Calls 2

getMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected