diff options
author | Vincent Ambo <mail@tazj.in> | 2022-09-06T14·53+0300 |
---|---|---|
committer | tazjin <tazjin@tvl.su> | 2022-09-11T12·04+0000 |
commit | 33059de43112f6199b4d51f8757236eb5f717c13 (patch) | |
tree | 005052ff594a803c6a9467623aa62232aa2254f6 /tvix/eval | |
parent | f68c76d07daf9794797b1056ce39e8e1bdeca8e4 (diff) |
refactor(tvix/eval): cut down one iteration over locals array r/4797
Caught by sterni in cl/6339 Change-Id: I2f2cd746114f14854cf599a7223a42a3e8ebe4fc Reviewed-on: https://cl.tvl.fyi/c/depot/+/6469 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
Diffstat (limited to 'tvix/eval')
-rw-r--r-- | tvix/eval/src/compiler/mod.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tvix/eval/src/compiler/mod.rs b/tvix/eval/src/compiler/mod.rs index b6a3f329a0d6..af64953f88ab 100644 --- a/tvix/eval/src/compiler/mod.rs +++ b/tvix/eval/src/compiler/mod.rs @@ -807,8 +807,9 @@ impl Compiler<'_, '_> { } // Second pass to place the values in the correct stack slots. - let indices: Vec<LocalIdx> = entries.iter().map(|(idx, _)| *idx).collect(); + let mut indices: Vec<LocalIdx> = vec![]; for (idx, value) in entries.into_iter() { + indices.push(idx); self.compile(idx, value); // Any code after this point will observe the value in the |