]> git.sur5r.net Git - i3/i3/commitdiff
no-op change: move bind->release check into loop
authorMichael Stapelberg <michael@stapelberg.de>
Wed, 24 May 2017 18:41:17 +0000 (20:41 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Wed, 24 May 2017 18:41:17 +0000 (20:41 +0200)
We don’t have to negate the check anymore, making it more readable.

src/bindings.c

index 0a994f554426c942c90fdc87329f0275dba48801..e9aec2c6fd694c70b7a86b02fbd8ec2b568852c5 100644 (file)
@@ -268,14 +268,12 @@ static Binding *get_binding(i3_event_state_mask_t state_filtered, bool is_releas
                 const bool mods_match = modifiers_match(modifiers_mask, modifiers_state);
                 DLOG("binding_keycode->modifiers = %d, modifiers_mask = %d, modifiers_state = %d, mods_match = %s\n",
                      binding_keycode->modifiers, modifiers_mask, modifiers_state, (mods_match ? "yes" : "no"));
-                if (mods_match) {
+                if (mods_match || (bind->release == B_UPON_KEYRELEASE_IGNORE_MODS && is_release)) {
                     found_keycode = true;
                     break;
                 }
             }
-            if (!found_keycode &&
-                (bind->release != B_UPON_KEYRELEASE_IGNORE_MODS ||
-                 !is_release)) {
+            if (!found_keycode) {
                 continue;
             }
         }