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

Method union

crates/kernel/src/equiv.rs:75–90  ·  view source on GitHub ↗

Union by rank. Returns true if sets were different.

(&mut self, a: usize, b: usize)

Source from the content-addressed store, hash-verified

73}
74
75impl EquivManager {
76 pub fn new() -> Self {
77 EquivManager {
78 key_to_node: FxHashMap::default(),
79 parent: Vec::new(),
80 rank: Vec::new(),
81 node_to_key: Vec::new(),
82 }
83 }
84
85 /// Reset all equivalence information.
86 pub fn clear(&mut self) {
87 self.key_to_node.clear();
88 self.parent.clear();
89 self.rank.clear();
90 self.node_to_key.clear();
91 }
92
93 /// Get or create a node index for a composite key.

Callers 1

add_equivMethod · 0.80

Calls 1

findMethod · 0.45

Tested by

no test coverage detected