tSimplify logic in match(). - st - [fork] customized build of st, the simple te… | |
git clone git://src.adamsgaard.dk/st | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 1fa27b93f9a78ee78a35a5449bb8c4d0c3ef0f1b | |
parent 3d3c37bc70042cd2f4bbc8f6ea5fceb2311f0a32 | |
Author: Mark Edgar <[email protected]> | |
Date: Sat, 19 Oct 2013 14:56:40 +0200 | |
Simplify logic in match(). | |
Diffstat: | |
M st.c | 10 +--------- | |
1 file changed, 1 insertion(+), 9 deletions(-) | |
--- | |
diff --git a/st.c b/st.c | |
t@@ -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 |