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

Bryce Harrington bryce at osg.samsung.com
Wed Apr 12 17:18:22 UTC 2017


On Fri, Apr 07, 2017 at 03:27:53PM -0500, Derek Foreman wrote:
> 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>

Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>

This is a simple refactor that can be landed independently of the rest
of the patchset.

> ---
>  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
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list