From 3331192cfa54b912a674c8f77dd0bea0cca1e163 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Mon, 2 Jan 2017 17:56:52 +0100 Subject: [PATCH] Simplify the expression of isWheelAction. Add missing braces. --- right/src/action.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/right/src/action.c b/right/src/action.c index 694d2f5..5935341 100644 --- a/right/src/action.c +++ b/right/src/action.c @@ -99,12 +99,11 @@ static bool wasPreviousMouseActionWheelAction = false; static void handleMouseKey(usb_mouse_report_t *report, uhk_key_t key, const uint8_t *prevKeyStates, const uint8_t *currKeyStates, uint8_t keyId) { - bool isWheelAction; - - if (!key_is_pressed(prevKeyStates, currKeyStates, keyId)) + if (!key_is_pressed(prevKeyStates, currKeyStates, keyId)) { return; + } - isWheelAction = !!(key.mouse.scrollActions) && !(key.mouse.moveActions) && !(key.mouse.buttonActions); + bool isWheelAction = key.mouse.scrollActions && !key.mouse.moveActions && !key.mouse.buttonActions; if (isWheelAction && wasPreviousMouseActionWheelAction) { mouseWheelDivisorCounter++;