From 183f26f415dd420a325b3cc99c15f19eac645828 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 bcf0cff5..183eb9ff 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() {