The check here is logically equivalent to (a != b) but much harder to read.
Lets change that.

V728 An excessive check can be simplified. The '(A && !B) || (!A && B)'
expression is equivalent to the 'bool(A) != bool(B)' expression.

Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>
---
 src/wcmUSB.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index 8ded958..f3b6df0 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -1419,8 +1419,7 @@ static void usbParseKeyEvent(WacomCommonPtr common,
                        ds->device_id = TOUCH_DEVICE_ID;
                        ds->proximity = event->value;
                        /* time stamp for 2FGT gesture events */
-                       if ((ds->proximity && !dslast->proximity) ||
-                           (!ds->proximity && dslast->proximity))
+                       if (ds->proximity != dslast->proximity)
                                ds->sample = (int)GetTimeInMillis();
                        break;
 
@@ -1431,8 +1430,7 @@ static void usbParseKeyEvent(WacomCommonPtr common,
                        ds->device_id = TOUCH_DEVICE_ID;
                        ds->proximity = event->value;
                        /* time stamp for 2GT gesture events */
-                       if ((ds->proximity && !dslast->proximity) ||
-                           (!ds->proximity && dslast->proximity))
+                       if (ds->proximity != dslast->proximity)
                                ds->sample = (int)GetTimeInMillis();
                        /* Second finger events will be considered in
                         * combination with the first finger data */
-- 
2.18.0


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to