From 2debe68cad278b63b952ffbd26f02d52dffb8233 Mon Sep 17 00:00:00 2001 From: jumerckx <31353884+jumerckx@users.noreply.github.com> Date: Mon, 7 Oct 2024 14:25:51 +0200 Subject: [PATCH] don't copy if `should_copy` is false --- src/EGraphs/egraph.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EGraphs/egraph.jl b/src/EGraphs/egraph.jl index a4f0e5f3..2609da02 100644 --- a/src/EGraphs/egraph.jl +++ b/src/EGraphs/egraph.jl @@ -273,7 +273,7 @@ function add!(g::EGraph{ExpressionType,Analysis}, n::VecExpr, should_copy::Bool) g.memo[n] = id add_class_by_op(g, n, id) - eclass = EClass{Analysis}(id, VecExpr[copy(n)], Pair{VecExpr,Id}[], make(g, n)) + eclass = EClass{Analysis}(id, VecExpr[n], Pair{VecExpr,Id}[], make(g, n)) g.classes[IdKey(id)] = eclass modify!(g, eclass) push!(g.pending, n => id)