diff --git a/hercules_opt/src/editor.rs b/hercules_opt/src/editor.rs index 17cea32500ab86779c01e37e2b03db842f9f3712..ce34469970afa7107d375ce3aa4c8e549474d773 100644 --- a/hercules_opt/src/editor.rs +++ b/hercules_opt/src/editor.rs @@ -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() {