From: Peter Hutterer Date: Thu, 13 Feb 2020 11:09:24 +0000 (+1000) Subject: Invert an if condition X-Git-Tag: libevdev-1.8.901~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2056da95174fa8c49e7caee58054809d99bc7dcb;p=platform%2Fupstream%2Flibevdev.git 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 --- 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