From 1343e8e52e53f064ca51babd88f9b328c77a5932 Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Sat, 24 Apr 2021 02:13:56 -0500 Subject: [PATCH] chore(ppu): flatten if statement --- src/ppu.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/ppu.rs b/src/ppu.rs index fcbba47..85d74df 100644 --- a/src/ppu.rs +++ b/src/ppu.rs @@ -82,13 +82,11 @@ impl Ppu { self.obj_buffer.clear(); self.stat.set_mode(Mode::HBlank); + } else if self.control.lcd_enabled() { + // Only Draw when the LCD Is Enabled + self.draw(self.cycles.into()); } else { - if self.control.lcd_enabled() { - // Only Draw when the LCD Is Enabled - self.draw(self.cycles.into()); - } else { - self.reset(); - } + self.reset(); } } Mode::HBlank => {