[PATCH 2/4] fix: compress logic expression in function match

From: Markus Teich <markus.teich_AT_stusta.mhn.de>
Date: Sat, 22 Jun 2013 23:06:34 +0200

---
 st.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/st.c b/st.c
index a5d6c87..2e45502 100644
--- a/st.c
+++ b/st.c
_AT_@ -3364,13 +3364,9 @@ 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((state & mask) != state)
-		return false;
-	return true;
+	return (mask != XK_NO_MOD || !state)
+		&& (mask == XK_ANY_MOD || mask == XK_NO_MOD || state)
+		&& ((state & mask) == state);
 }
 
 void
-- 
1.8.2
--------------020503010702010109060608
Content-Type: text/x-patch;
 name="0003-fix-consistent-usage-of-bitmask-operations-on-unicod.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="0003-fix-consistent-usage-of-bitmask-operations-on-unicod.pa";
 filename*1="tch"
Received on Mon Sep 17 2001 - 00:00:00 CEST

This archive was generated by hypermail 2.3.0 : Sat Jun 22 2013 - 23:36:03 CEST