summaryrefslogtreecommitdiff
path: root/graph/src
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2023-02-12 12:07:34 +0800
committerJSDurand <mmemmew@gmail.com>2023-02-12 12:07:34 +0800
commit987c84f3454c687cca0efe0d471fcf00e052ecab (patch)
tree04b9cf073a12adfb5d07ae308c3809e88cf4ebd2 /graph/src
parent265ff8f87dc7392fdf701f811eb2bf54d7bc6678 (diff)
Added the functionality of split or clone.
I need more than the ability to clone nodes: I also need to split the nodes. Now this seems to be correctly added.
Diffstat (limited to 'graph/src')
-rw-r--r--graph/src/labelled/binary.rs4
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(())