From 2056da95174fa8c49e7caee58054809d99bc7dcb Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 13 Feb 2020 21:09:24 +1000 Subject: [PATCH] Invert an if condition Go from: if (a != b) continue; foo; to: if (a == b) { foo; } Basically just an indentation change after the condition inversion, makes the follow-up patch easier to review. Signed-off-by: Peter Hutterer --- libevdev/libevdev.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/libevdev/libevdev.c b/libevdev/libevdev.c index 100c169..f8d59da 100644 --- a/libevdev/libevdev.c +++ b/libevdev/libevdev.c @@ -740,14 +740,13 @@ terminate_slots(struct libevdev *dev, bool touches_stopped = false; for (int slot = 0; slot < dev->num_slots; slot++) { - if (changes[slot].state != TOUCH_CHANGED) - continue; - - queue_push_event(dev, EV_ABS, ABS_MT_SLOT, slot); - queue_push_event(dev, EV_ABS, ABS_MT_TRACKING_ID, -1); + if (changes[slot].state == TOUCH_CHANGED) { + queue_push_event(dev, EV_ABS, ABS_MT_SLOT, slot); + queue_push_event(dev, EV_ABS, ABS_MT_TRACKING_ID, -1); - *last_reported_slot = slot; - touches_stopped = true; + *last_reported_slot = slot; + touches_stopped = true; + } } /* If any of the touches stopped, we need to split the sync state -- 2.7.4