diff --git a/lib/src/sql/function.rs b/lib/src/sql/function.rs index 4af690a4..0110d790 100644 --- a/lib/src/sql/function.rs +++ b/lib/src/sql/function.rs @@ -55,10 +55,9 @@ impl Function { fnc::cast::run(ctx, s, a) } Function::Normal(ref s, ref e) => { - let mut a: Vec = vec![]; + let mut a: Vec = Vec::with_capacity(e.len()); for v in e { - let v = v.compute(ctx, opt, txn, doc).await?; - a.push(v); + a.push(v.compute(ctx, opt, txn, doc).await?); } fnc::run(ctx, s, a).await }