forked from AbleScript/ablescript
Removed clone
This commit is contained in:
parent
6149dfddb6
commit
183f26f415
|
@ -408,19 +408,21 @@ impl ExecEnv {
|
||||||
}
|
}
|
||||||
Functio::Chain { functios, kind } => {
|
Functio::Chain { functios, kind } => {
|
||||||
let (left_functio, right_functio) = *functios;
|
let (left_functio, right_functio) = *functios;
|
||||||
let (left_args, right_args) = match kind {
|
match kind {
|
||||||
crate::variables::FunctioChainKind::Equal => {
|
crate::variables::FunctioChainKind::Equal => {
|
||||||
let (l, r) = args.split_at(args.len() / 2);
|
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 => {
|
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) => {
|
Functio::Eval(code) => {
|
||||||
if !args.is_empty() {
|
if !args.is_empty() {
|
||||||
|
|
Loading…
Reference in a new issue