From 2e638598e4818ad26ecfc6ba085b8ec5c890e266 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Sun, 30 Jul 2023 06:55:45 -0700 Subject: [PATCH] Simplify condition --- src/common/InputHandler.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/InputHandler.ts b/src/common/InputHandler.ts index fb8862a0..46db6110 100644 --- a/src/common/InputHandler.ts +++ b/src/common/InputHandler.ts @@ -2915,7 +2915,7 @@ export class InputHandler extends Disposable implements IInputHandler { const spec = slots.shift() as string; if (/^\d+$/.exec(idx)) { const index = parseInt(idx); - if (isValidColorIndex(index) && index < 256) { + if (isValidColorIndex(index)) { if (spec === '?') { event.push({ type: ColorRequestType.REPORT, index }); } else { @@ -3073,7 +3073,7 @@ export class InputHandler extends Disposable implements IInputHandler { for (let i = 0; i < slots.length; ++i) { if (/^\d+$/.exec(slots[i])) { const index = parseInt(slots[i]); - if (isValidColorIndex(index) && index < 256) { + if (isValidColorIndex(index)) { event.push({ type: ColorRequestType.RESTORE, index }); } } @@ -3431,5 +3431,5 @@ class DirtyRowTracker implements IDirtyRowTracker { } function isValidColorIndex(value: number): value is ColorIndex { - return 0 <= value && value < 259; + return 0 <= value && value < 256; }