mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2025-12-24 20:30:06 +01:00
Simplify a bit state setter
set_bit_state does exactly what the previous if/else did. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
551134b5fa
commit
09a1f6e427
1 changed files with 1 additions and 4 deletions
|
|
@ -462,10 +462,7 @@ update_key_state(struct libevdev *dev, const struct input_event *e)
|
|||
if (e->code > KEY_MAX)
|
||||
return 1;
|
||||
|
||||
if (e->value == 0)
|
||||
clear_bit(dev->key_values, e->code);
|
||||
else
|
||||
set_bit(dev->key_values, e->code);
|
||||
set_bit_state(dev->key_values, e->code, e->value != 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue