[PATCH wayland 7/9] client: Simplify some logic in queue_event

Derek Foreman derekf at osg.samsung.com
Fri Apr 7 20:27:53 UTC 2017


Both the blocks in this if/else clause do the same thing, so combine
the comparisons into one.

No functional change.

Signed-off-by: Derek Foreman <derekf at osg.samsung.com>
---
 src/wayland-client.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/wayland-client.c b/src/wayland-client.c
index a77cf71..7243d3d 100644
--- a/src/wayland-client.c
+++ b/src/wayland-client.c
@@ -1228,10 +1228,7 @@ queue_event(struct wl_display *display, int len)
 		return 0;
 
 	proxy = wl_map_lookup(&display->objects, id);
-	if (proxy == WL_ZOMBIE_OBJECT) {
-		wl_connection_consume(display->connection, size);
-		return size;
-	} else if (proxy == NULL) {
+	if (!proxy || proxy == WL_ZOMBIE_OBJECT) {
 		wl_connection_consume(display->connection, size);
 		return size;
 	}
-- 
2.11.0



More information about the wayland-devel mailing list