Skip to content
Snippets Groups Projects
Commit 3c8eaae2 authored by Aaron Councilman's avatar Aaron Councilman
Browse files

add_node only adds to def use map if not already present

parent 205e68e2
No related branches found
No related tags found
1 merge request!205Fork reshape
......@@ -457,7 +457,7 @@ impl<'a, 'b> FunctionEdit<'a, 'b> {
pub fn add_node(&mut self, node: Node) -> NodeID {
let id = NodeID::new(self.num_node_ids());
// Added nodes need to have an entry in the def-use map.
self.updated_def_use.insert(id, HashSet::new());
self.updated_def_use.entry(id).or_insert(HashSet::new());
// Added nodes use other nodes, and we need to update their def-use
// entries.
for u in get_uses(&node).as_ref() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment