From 10219d7640afee1784baff3cb142937f9e777e56 Mon Sep 17 00:00:00 2001 From: Matt Godbolt Date: Sat, 2 Nov 2024 18:25:12 -0500 Subject: [PATCH] More jslintsimpli --- src/emulator.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/emulator.js b/src/emulator.js index 6a5045e..82cbd36 100644 --- a/src/emulator.js +++ b/src/emulator.js @@ -245,7 +245,7 @@ export class Emulator { frameFunc(now) { requestAnimationFrame(this.onAnimFrame); // Take snapshot - if (this.loop === true && this.state === null && this.cpu.currentCycles >= this.loopStart) { + if (this.loop && !this.state && this.cpu.currentCycles >= this.loopStart) { this.pause(); this.state = this.snapshot.save(this.cpu).state; this.start(); @@ -253,11 +253,7 @@ export class Emulator { } // Loop back - if ( - this.loop === true && - this.state !== null && - this.cpu.currentCycles >= this.loopStart + this.loopLength - ) { + if (this.loop && this.state && this.cpu.currentCycles >= this.loopStart + this.loopLength) { this.pause(); this.snapshot.load(this.state, this.cpu); this.cpu.currentCycles = this.loopStart;