[PATCH weston 06/19] compositor-drm: Simplify logic in setup_output_seat_constraint

Jonas Ådahl jadahl at gmail.com
Wed Jul 1 01:52:18 PDT 2015


On Wed, Jun 03, 2015 at 03:53:25PM -0500, Derek Foreman wrote:
> Use early return for a slight simplification.
> 
> Signed-off-by: Derek Foreman <derekf at osg.samsung.com>

Reviewed-by: Jonas Ådahl <jadahl at gmail.com>

> ---
>  src/compositor-drm.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/src/compositor-drm.c b/src/compositor-drm.c
> index bf921be..b13e0c0 100644
> --- a/src/compositor-drm.c
> +++ b/src/compositor-drm.c
> @@ -1934,10 +1934,12 @@ setup_output_seat_constraint(struct drm_compositor *ec,
>  		struct udev_seat *seat;
>  
>  		seat = udev_seat_get_named(&ec->input, s);
> -		if (seat)
> -			seat->base.output = output;
> +		if (!seat)
> +			return;
> +
> +		seat->base.output = output;
>  
> -		if (seat && seat->base.pointer)
> +		if (seat->base.pointer)
>  			weston_pointer_clamp(seat->base.pointer,
>  					     &seat->base.pointer->x,
>  					     &seat->base.pointer->y);
> -- 
> 2.1.4
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list