()
| 156 | /// Returns None if the key is not in the union-find. |
| 157 | /// |
| 158 | /// Like `is_equiv`, takes the lookup key by reference so callers can |
| 159 | /// reuse a single `EqKey` binding across multiple queries without |
| 160 | /// cloning it for each call. |
| 161 | pub fn find_root_key(&mut self, key: &EqKey) -> Option<EqKey> { |
| 162 | let node = *self.key_to_node.get(key)?; |
| 163 | let root = self.find(node); |
| 164 | Some(self.node_to_key[root]) |
| 165 | } |
| 166 | |
| 167 | /// Record that two composite keys are definitionally equal. |