refactor(tvix/eval): cut down one iteration over locals array

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>
This commit is contained in:
Vincent Ambo 2022-09-06 17:53:49 +03:00 committed by tazjin
parent f68c76d07d
commit 33059de431

View file

@ -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