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

Derek Foreman derekf at osg.samsung.com
Wed Jun 3 13:53:25 PDT 2015


Use early return for a slight simplification.

Signed-off-by: Derek Foreman <derekf at osg.samsung.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



More information about the wayland-devel mailing list