From 3cbd48318d3ace8af15b8d7f16b06106e7b2542d Mon Sep 17 00:00:00 2001 From: Jonas Date: Mon, 27 Nov 2023 22:59:58 +0100 Subject: [PATCH] Fix efficiency issue --- smt-log-parser/src/parsers/z3/inst_graph.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/smt-log-parser/src/parsers/z3/inst_graph.rs b/smt-log-parser/src/parsers/z3/inst_graph.rs index 90738478..258f52ed 100644 --- a/smt-log-parser/src/parsers/z3/inst_graph.rs +++ b/smt-log-parser/src/parsers/z3/inst_graph.rs @@ -337,15 +337,9 @@ impl InstGraph { } } - fn fresh_line_nr(&self, line_nr: usize) -> bool { - self.inst_graph - .node_weights() - .all(|node| node.line_nr != line_nr) - } - fn add_node(&mut self, node_data: NodeData) { let line_nr = node_data.line_nr; - if self.fresh_line_nr(line_nr) { + if !self.node_of_line_nr.contains_key(&line_nr) { let node = self.inst_graph.add_node(node_data); self.orig_graph.add_node(node_data); self.node_of_line_nr.insert(line_nr, node);