Skip to content

Commit

Permalink
minor optimization in add
Browse files Browse the repository at this point in the history
  • Loading branch information
dewert99 committed Apr 8, 2024
1 parent b0ded73 commit 4927512
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/raw/egraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -604,12 +604,12 @@ impl<L: Language, D, U: UndoLogT<L, D>> RawEGraph<L, D, U> {
let (existing_id, hash) = this.residual.memo.get_kv(&enode);
if let Some((existing_node, &existing_id)) = existing_id {
let pre = pre_union(existing_node, &enode);
let canon_id = this.find(existing_id);
// when explanations are enabled, we need a new representative for this expr
if let Some(existing_id) = handle_equiv(outer, existing_id, &original) {
existing_id
} else {
let this = get_self(outer);
let canon_id = this.find_mut(existing_id);
let new_id = this.residual.unionfind.make_set();
this.undo_log.add_node(&original, &[], new_id);
this.undo_log.union(canon_id, new_id, Vec::new());
Expand Down

0 comments on commit 4927512

Please sign in to comment.