We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b0ee194 commit 786eb2cCopy full SHA for 786eb2c
vm/src/frame.rs
@@ -141,10 +141,8 @@ impl Frame {
141
value
142
}
143
144
- pub fn fetch_instruction(&self) -> bytecode::Instruction {
145
- // TODO: an immutable reference is enough, we should not
146
- // clone the instruction.
147
- let ins2 = self.code.instructions[*self.lasti.borrow()].clone();
+ pub fn fetch_instruction(&self) -> &bytecode::Instruction {
+ let ins2 = &self.code.instructions[*self.lasti.borrow()];
148
*self.lasti.borrow_mut() += 1;
149
ins2
150
0 commit comments