🚧 this seemed to improve perf a little but idk why

main
_ 2023-10-02 19:27:30 -05:00
parent b35dc346e8
commit 4e23f51634
1 changed files with 3 additions and 3 deletions

View File

@ -510,9 +510,9 @@ impl State {
self.current_block = Rc::clone (&self.chunk.blocks [frame.block_idx]);
}
fn fetch (&self) -> Instruction {
fn fetch (&self) -> &Instruction {
match self.current_block.instructions.get (self.stack_top.program_counter) {
Some (x) => *x,
Some (x) => x,
None => {
dbg! (&self.stack, &self.stack_top);
panic! ("program_counter went out of bounds");
@ -532,7 +532,7 @@ impl State {
self.make_step_error (msg, &instruction)
};
match instruction {
match *instruction {
Instruction::Add (a, b, c) => {
if self.op_add (a, b, c) {
self.stack_top.program_counter += 1;