From c1471bcdb7e0110e4d2003ee7816c7075fe2e1ce Mon Sep 17 00:00:00 2001 From: Erin Date: Tue, 14 Dec 2021 23:05:21 +0100 Subject: [PATCH] Removed clone --- ablescript/src/interpret.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/ablescript/src/interpret.rs b/ablescript/src/interpret.rs index bcf0cff..183eb9f 100644 --- a/ablescript/src/interpret.rs +++ b/ablescript/src/interpret.rs @@ -408,19 +408,21 @@ impl ExecEnv { } Functio::Chain { functios, kind } => { let (left_functio, right_functio) = *functios; - let (left_args, right_args) = match kind { + match kind { crate::variables::FunctioChainKind::Equal => { let (l, r) = args.split_at(args.len() / 2); - // TODO: avoid this clone - (l.to_owned(), r.to_owned()) + + self.fn_call_with_values(left_functio, l, span)?; + self.fn_call_with_values(right_functio, r, span)?; } crate::variables::FunctioChainKind::ByArity => { - Self::deinterlace(args, (left_functio.arity(), right_functio.arity())) + let (l, r) = + Self::deinterlace(args, (left_functio.arity(), right_functio.arity())); + + self.fn_call_with_values(left_functio, &l, span)?; + self.fn_call_with_values(right_functio, &r, span)?; } }; - - self.fn_call_with_values(left_functio, &left_args, span)?; - self.fn_call_with_values(right_functio, &right_args, span)?; } Functio::Eval(code) => { if !args.is_empty() {