chore: remove redundant clone

This commit is contained in:
microproofs 2023-12-13 19:17:34 -05:00 committed by Kasey
parent a0ec92897b
commit 6a10be3e82
1 changed files with 2 additions and 3 deletions

View File

@ -194,10 +194,9 @@ impl Program<Name> {
Term::Constant(c) if matches!(c.as_ref(), Constant::String(_)) => {} Term::Constant(c) if matches!(c.as_ref(), Constant::String(_)) => {}
Term::Constant(_) | Term::Var(_) | Term::Builtin(_) => { Term::Constant(_) | Term::Var(_) | Term::Builtin(_) => {
let body = Rc::make_mut(body); 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); 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);
} }
_ => {} _ => {}
} }