Skip to content

Commit

Permalink
refactor: use forEach to execute hints
Browse files Browse the repository at this point in the history
  • Loading branch information
zmalatrax committed Jul 23, 2024
1 parent 8522d5c commit ea22426
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/vm/virtualMachine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,7 @@ export class VirtualMachine {
* - Run the instruction
*/
step(hints?: Hint[]): void {
if (hints) {
hints.map((hint) => this.executeHint(hint));
}
hints?.forEach((hint) => this.executeHint(hint));
const maybeEncodedInstruction = this.memory.get(this.pc);
if (maybeEncodedInstruction === undefined) {
throw new UndefinedInstruction(this.pc);
Expand Down

0 comments on commit ea22426

Please sign in to comment.