From 4afae2968e381643409371887df48aec51faad68 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 16 Oct 2018 12:25:51 -0400 Subject: [PATCH] Optimize --- src/console.c | 7 +------ src/hu_stuff.c | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/console.c b/src/console.c index c5675609f..a7d5fcef0 100644 --- a/src/console.c +++ b/src/console.c @@ -751,18 +751,13 @@ boolean CON_Responder(event_t *ev) if (ev->data1 >= KEY_MOUSE1) // See also: HUD_Responder { INT32 i; - boolean p1control = false; - for (i = 0; i < num_gamecontrols; i++) { if (gamecontrol[i][0] == ev->data1 || gamecontrol[i][1] == ev->data1) - { - p1control = true; break; - } } - if (!p1control) + if (i == num_gamecontrols) return false; } diff --git a/src/hu_stuff.c b/src/hu_stuff.c index c6c9c50f6..c394e0330 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -1076,18 +1076,13 @@ boolean HU_Responder(event_t *ev) if (ev->data1 >= KEY_MOUSE1) { INT32 i; - boolean p1control = false; - for (i = 0; i < num_gamecontrols; i++) { if (gamecontrol[i][0] == ev->data1 || gamecontrol[i][1] == ev->data1) - { - p1control = true; break; - } } - if (!p1control) + if (i == num_gamecontrols) return false; }