mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2025-12-20 04:40:07 +01:00
input: improve keyboard keys array traversal in notify_key()
The loop in notify_key() that traverses the keyboard keys array has been improved by adding a break statement after removing a key and simplifying the loop structure. This eliminates unnecessary iterations and removes ambiguity in the code flow, making it both more efficient and clearer. Signed-off-by: Taehyeon Jeong wxogus25@gmail.com
This commit is contained in:
parent
37bf61c68c
commit
0add10986d
1 changed files with 1 additions and 0 deletions
|
|
@ -2685,6 +2685,7 @@ notify_key(struct weston_seat *seat, const struct timespec *time, uint32_t key,
|
|||
if (state == WL_KEYBOARD_KEY_STATE_PRESSED)
|
||||
return;
|
||||
*k = *--end;
|
||||
break;
|
||||
}
|
||||
}
|
||||
keyboard->keys.size = (void *) end - keyboard->keys.data;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue