From 2deb5e1dfd03720df2e61d73f0892bfd7be8c281 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Wed, 2 Jul 2025 15:56:18 -0500 Subject: [PATCH] compositor: use early return in set sync/desync Trivial change for clarity. Signed-off-by: Derek Foreman --- libweston/compositor.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libweston/compositor.c b/libweston/compositor.c index 856473b50..8b23d7bc5 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -5895,8 +5895,10 @@ subsurface_set_sync(struct wl_client *client, struct wl_resource *resource) { struct weston_subsurface *sub = wl_resource_get_user_data(resource); - if (sub) - sub->synchronized = true; + if (!sub) + return; + + sub->synchronized = true; } static void @@ -5904,7 +5906,10 @@ subsurface_set_desync(struct wl_client *client, struct wl_resource *resource) { struct weston_subsurface *sub = wl_resource_get_user_data(resource); - if (sub && sub->synchronized) { + if (!sub) + return; + + if (sub->synchronized) { sub->synchronized = false; /* If sub became effectively desynchronized, flush. */