Skip to content

Commit

Permalink
Fix efficiency issue
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasAlaif committed Nov 27, 2023
1 parent a56571b commit 3cbd483
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions smt-log-parser/src/parsers/z3/inst_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3cbd483

Please sign in to comment.