diff options
Diffstat (limited to 'graph/src')
-rw-r--r-- | graph/src/labelled/binary.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/graph/src/labelled/binary.rs b/graph/src/labelled/binary.rs index 4ec7378..ce3a867 100644 --- a/graph/src/labelled/binary.rs +++ b/graph/src/labelled/binary.rs @@ -603,9 +603,11 @@ impl<'a, T: GraphLabel> BuilderMut for PLGBuilderMut<'a, T> { // node_id is now guaranteed to be valid. + let old_label = self.graph.nodes.get(node_id).unwrap().label; + self.graph.nodes.get_mut(node_id).unwrap().label = label; - self.graph.label_index_map.remove(&label); + self.graph.label_index_map.remove(&old_label); self.graph.label_index_map.insert(label, node_id); Ok(()) |