about summary refs log tree commit diff
path: root/tvix/eval/src/value/json.rs
diff options
context:
space:
mode:
authorBob van der Linden <bobvanderlinden@gmail.com>2024-11-03T20·28+0100
committerBob van der Linden <bobvanderlinden@gmail.com>2024-11-04T10·39+0000
commitcae3afc758eb7c4a24a77e03aae924c210ab7ffe (patch)
treef514e74109094d8fe038f8db6c9e41529c0057ac /tvix/eval/src/value/json.rs
parent9aa479648b63cbffdae4c6365549827692ca1914 (diff)
feat(tvix/eval): use with_capacity instead of a growing vec r/8891
Change-Id: I4d89663eb9ac772ce1008ed5ee218bc7016164e7
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12733
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/value/json.rs')
-rw-r--r--tvix/eval/src/value/json.rs2
1 files changed, 1 insertions, 1 deletions
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?;