From cae3afc758eb7c4a24a77e03aae924c210ab7ffe Mon Sep 17 00:00:00 2001 From: Bob van der Linden Date: Sun, 3 Nov 2024 21:28:32 +0100 Subject: feat(tvix/eval): use with_capacity instead of a growing vec Change-Id: I4d89663eb9ac772ce1008ed5ee218bc7016164e7 Reviewed-on: https://cl.tvl.fyi/c/depot/+/12733 Reviewed-by: flokli Tested-by: BuildkiteCI --- tvix/eval/src/value/json.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tvix/eval/src/value/json.rs') diff --git a/tvix/eval/src/value/json.rs b/tvix/eval/src/value/json.rs index 1ef3f9911def..807dc55f97cc 100644 --- a/tvix/eval/src/value/json.rs +++ b/tvix/eval/src/value/json.rs @@ -40,7 +40,7 @@ impl Value { } Value::List(l) => { - let mut out = vec![]; + let mut out = Vec::with_capacity(l.len()); for val in l.into_iter() { let (json_item, ctx) = Box::pin(val.into_contextful_json(co)).await?; -- cgit 1.4.1