diff options
author | Bob van der Linden <bobvanderlinden@gmail.com> | 2024-11-03T20·28+0100 |
---|---|---|
committer | Bob van der Linden <bobvanderlinden@gmail.com> | 2024-11-04T10·39+0000 |
commit | cae3afc758eb7c4a24a77e03aae924c210ab7ffe (patch) | |
tree | f514e74109094d8fe038f8db6c9e41529c0057ac /tvix/eval | |
parent | 9aa479648b63cbffdae4c6365549827692ca1914 (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')
-rw-r--r-- | tvix/eval/src/value/json.rs | 2 |
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?; |