diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-08-04 16:26:21 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2017-08-04 16:26:21 -0400 |
commit | 95653c0bf745bab67978873880cfd2ad586c1198 (patch) | |
tree | a01950296f0058a1da2d9528d21b74bdb56a4a4a | |
parent | de17ce19bed4fd8b9f7322e275cdc3cc349db5ab (diff) |
Minor nitpicking in wl_compositor
-rw-r--r-- | examples/compositor/wl_compositor.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/examples/compositor/wl_compositor.c b/examples/compositor/wl_compositor.c index c9dfda56..b022e71c 100644 --- a/examples/compositor/wl_compositor.c +++ b/examples/compositor/wl_compositor.c @@ -87,19 +87,13 @@ static void destroy_surface_listener(struct wl_listener *listener, void *data) { struct wlr_surface *surface = data; state = wl_container_of(listener, state, destroy_surface_listener); - struct wl_resource *res = NULL, *_res; - wl_list_for_each(_res, &state->surfaces, link) { + struct wl_resource *res = NULL; + wl_list_for_each(res, &state->surfaces, link) { if (_res == surface->resource) { - res = _res; + wl_list_remove(&res->link); break; } } - - if (!res) { - return; - } - - wl_list_remove(&res->link); } static void wl_compositor_create_surface(struct wl_client *client, |