mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
Collapse duplicate proto nodes when assigning stable ids
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user