mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-29 05:40:16 -04:00
event-loop: optimize timer check logic
the 'has_timers' flag can be returned directly without having to track all the ready events when a timer is found ready. Signed-off-by: Yang Wang <KevinYang.Wang@amd.com>
This commit is contained in:
parent
b1b97e8d34
commit
11b17c1286
1 changed files with 3 additions and 1 deletions
|
|
@ -1082,8 +1082,10 @@ wl_event_loop_dispatch(struct wl_event_loop *loop, int timeout)
|
|||
|
||||
for (i = 0; i < count; i++) {
|
||||
source = ep[i].data.ptr;
|
||||
if (source == &loop->timers.base)
|
||||
if (source == &loop->timers.base) {
|
||||
has_timers = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (has_timers) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue