Skip to content

Commit

Permalink
Fix the performance issue with math test suite (#206)
Browse files Browse the repository at this point in the history
* use reference instead of clone

* fix
  • Loading branch information
yihozhang authored Sep 26, 2022
1 parent 620e34a commit 4cfd22b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/math.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ impl Analysis<Math> for ConstantFold {
}

fn modify(egraph: &mut EGraph, id: Id) {
let class = egraph[id].clone();
if let Some((c, pat)) = class.data {
let data = egraph[id].data.clone();
if let Some((c, pat)) = data {
if egraph.are_explanations_enabled() {
egraph.union_instantiations(
&pat,
Expand Down

0 comments on commit 4cfd22b

Please sign in to comment.