From 6a10be3e82109006bc7e838c36c55694162e8d4c Mon Sep 17 00:00:00 2001 From: microproofs Date: Wed, 13 Dec 2023 19:17:34 -0500 Subject: [PATCH] chore: remove redundant clone --- crates/uplc/src/optimize/shrinker.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/uplc/src/optimize/shrinker.rs b/crates/uplc/src/optimize/shrinker.rs index c6b6ea7e..b1a98583 100644 --- a/crates/uplc/src/optimize/shrinker.rs +++ b/crates/uplc/src/optimize/shrinker.rs @@ -194,10 +194,9 @@ impl Program { Term::Constant(c) if matches!(c.as_ref(), Constant::String(_)) => {} Term::Constant(_) | Term::Var(_) | Term::Builtin(_) => { let body = Rc::make_mut(body); - // mutates body to replace all var occurrences with the arg - *body = substitute_var(body, parameter_name.clone(), &arg_term); lambda_applied_ids.push(arg_id); - *term = body.clone(); + // creates new body that replaces all var occurrences with the arg + *term = substitute_var(body, parameter_name.clone(), &arg_term); } _ => {} }