From 0720ea36c8ee7e957d292a9ca41f35b403f39062 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Wed, 15 Jul 2015 13:00:35 -0500 Subject: [PATCH] compositor-drm: Simplify logic in setup_output_seat_constraint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use early return for a slight simplification. Reviewed-by: Jonas Ã…dahl Signed-off-by: Derek Foreman --- 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 db498a63..42195ec2 100644 --- a/src/compositor-drm.c +++ b/src/compositor-drm.c @@ -2078,10 +2078,12 @@ setup_output_seat_constraint(struct drm_backend *b, struct udev_seat *seat; seat = udev_seat_get_named(&b->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);