optimize: dedup consts

This commit is contained in:
2025-05-15 19:11:34 +08:00
parent 864be73e77
commit 1e50322af0
8 changed files with 51 additions and 31 deletions

View File

@@ -458,7 +458,7 @@ impl<'vm> Thunk<'vm> {
_Thunk::SuspendedFrom(self as *const Thunk),
)
.unwrap_code();
let value = vm.eval(opcodes.clone(), env.get().unwrap().clone())?;
let value = vm.eval(opcodes.iter().copied(), env.get().unwrap().clone())?;
let _ = std::mem::replace(
&mut *self.thunk.borrow_mut(),
_Thunk::Value(value.clone().into()),