There is really no need to increment "n" if we never read the value. The
do-while() loop overwrites the value before it is read the first time.

Signed-off-by: David Herrmann <dh.herrm...@googlemail.com>
---
I am not sure what the intention is here. Either we want a normal "while()" loop
below and only do the post-dispatch if the real dispatch returned >0. Or, this
is just dead code and we can remove it.
I assumed the latter is true so this patch simply removes what has no effect.

 src/event-loop.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/event-loop.c b/src/event-loop.c
index a839daf..df4b8b8 100644
--- a/src/event-loop.c
+++ b/src/event-loop.c
@@ -403,11 +403,11 @@ wl_event_loop_dispatch(struct wl_event_loop *loop, int 
timeout)
        count = epoll_wait(loop->epoll_fd, ep, ARRAY_LENGTH(ep), timeout);
        if (count < 0)
                return -1;
-       n = 0;
+
        for (i = 0; i < count; i++) {
                source = ep[i].data.ptr;
                if (source->fd != -1)
-                       n += source->interface->dispatch(source, &ep[i]);
+                       source->interface->dispatch(source, &ep[i]);
        }
 
        wl_event_loop_process_destroy_list(loop);
-- 
1.7.12

_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to