diff options
author | Vincent Ambo <mail@tazj.in> | 2023-01-04T15·41+0300 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2023-01-04T16·30+0000 |
commit | 0c17718dd10f8b53b523eb8c54a525c7af166712 (patch) | |
tree | 6e4022a976a2eb00b51eb33b763c12014c7cab81 /tvix/eval/src | |
parent | 9b8ba915c8c006f55c12a8af927810a901e7a378 (diff) |
refactor(tvix/eval): avoid unnecessary pop/push in OpForce r/5583
Change-Id: Ic7559eaa43aa0dcc97babb7669770c0f7f959f1b Reviewed-on: https://cl.tvl.fyi/c/depot/+/7754 Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
Diffstat (limited to 'tvix/eval/src')
-rw-r--r-- | tvix/eval/src/vm.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/tvix/eval/src/vm.rs b/tvix/eval/src/vm.rs index 107aadb6e068..3dece0641281 100644 --- a/tvix/eval/src/vm.rs +++ b/tvix/eval/src/vm.rs @@ -1003,14 +1003,9 @@ impl<'o> VM<'o> { } OpCode::OpForce => { - let value = self.pop(); - - if let Value::Thunk(thunk) = value { - self.push(Value::Thunk(thunk)); + if let Some(Value::Thunk(_)) = self.stack.last() { let trampoline = fallible!(self, Thunk::force_trampoline(self)); return Ok(trampoline); - } else { - self.push(value); } } |