]> git.ipfire.org Git - thirdparty/systemd.git/commit
udev-builtin-input_ic: simplify loop in test_key()
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 2 Aug 2021 13:44:56 +0000 (15:44 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 7 Aug 2021 07:00:55 +0000 (09:00 +0200)
commit8b06c72969ee0af65a06cbeb2222e8108ca41d30
tree578367eeafcee29fb51ae3291b6fba6e21c91581
parent169d980bc86ccec7923578bf12cab23178dfa1de
udev-builtin-input_ic: simplify loop in test_key()

We would update 'found' using bit operations, but studiously ignore the actual
value and treat it as boolean. So just use a boolean variable instead. Because
there is a double loop, we would break the inner loop, but repeat the outer
loop, even though the boolean was already set. Add '&& !found' in the loop
conditions to break iteration immediately.
src/udev/udev-builtin-input_id.c