[hackers] [st] Simplify logic in match(). || Mark Edgar
commit 1fa27b93f9a78ee78a35a5449bb8c4d0c3ef0f1b
Author: Mark Edgar <medgar123_AT_gmail.com>
Date: Sat Oct 19 14:56:40 2013 +0200
Simplify logic in match().
diff --git a/st.c b/st.c
index 8cfa2f7..da2ce3f 100644
--- a/st.c
+++ b/st.c
_AT_@ -3501,15 +3501,7 @@ focus(XEvent *ev) {
static inline bool
match(uint mask, uint state) {
- state &= ~ignoremod;
-
- if(mask == XK_NO_MOD && state)
- return false;
- if(mask != XK_ANY_MOD && mask != XK_NO_MOD && !state)
- return false;
- if(mask == XK_ANY_MOD)
- return true;
- return state == mask;
+ return mask == XK_ANY_MOD || mask == (state & ~ignoremod);
}
void
Received on Mon Oct 28 2013 - 19:34:18 CET
This archive was generated by hypermail 2.3.0
: Mon Oct 28 2013 - 19:36:25 CET