refactor(tvix/eval): avoid unnecessary pop/push in OpForce
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>
This commit is contained in:
parent
9b8ba915c8
commit
0c17718dd1
1 changed files with 1 additions and 6 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue