Collapse duplicate proto nodes when assigning stable ids

This commit is contained in:
Dennis Kobert
2026-08-05 19:25:17 +00:00
parent 9fc4fcc7a0
commit 60f80682c5

View File

@@ -258,6 +258,11 @@ impl ProtoNetwork {
self.replace_node_id(&outwards_edges, NodeId(index as u64), sni);
self.nodes[index].0 = sni;
}
// Equal nodes hash to one id; the copies must go, or a pass that
// rewrites one of them (like adapter splicing) leaves the others stale.
let mut seen = HashSet::new();
self.nodes.retain(|(id, _)| seen.insert(*id));
}
// TODO: Remove