Skip to content

Commit 99a687a

Browse files
committed
Added suggestion to optimize a few lines of Bytecode pattern
1 parent 6865faa commit 99a687a

File tree

1 file changed

+2
-7
lines changed
  • Assets/Patterns/10. Bytecode/Scripts

1 file changed

+2
-7
lines changed

Assets/Patterns/10. Bytecode/Scripts/VM.cs

+2-7
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,8 @@ public void Interpret(int[] bytecode)
4747
}
4848
case Instruction.INST_LITERAL:
4949
{
50-
//Important that this i++ is not inside bytecode[i++] or it will not jump to next i
51-
i++;
52-
53-
int value = bytecode[i];
54-
55-
Push(value);
56-
50+
Push(bytecode[++i]);
51+
5752
break;
5853
}
5954
case Instruction.INST_GET_HEALTH:

0 commit comments

Comments
 (0)