From d49edc8243c9ccba7a4a5dc210f87e9fba03a444 Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Tue, 15 Aug 2017 15:27:28 +0200 Subject: wl_shell/compositor surface: do not check if it's in list before removing --- examples/compositor/wl_compositor.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'examples/compositor') diff --git a/examples/compositor/wl_compositor.c b/examples/compositor/wl_compositor.c index 034a7ff0..0bab345d 100644 --- a/examples/compositor/wl_compositor.c +++ b/examples/compositor/wl_compositor.c @@ -7,17 +7,7 @@ #include "compositor.h" static void destroy_surface_listener(struct wl_listener *listener, void *data) { - struct wlr_surface *surface = wl_resource_get_user_data(data); - struct wl_compositor_state *state = surface->compositor_data; - assert(data == surface->resource); - - struct wl_resource *res = NULL; - wl_list_for_each(res, &state->surfaces, link) { - if (res == surface->resource) { - wl_list_remove(wl_resource_get_link(res)); - break; - } - } + wl_list_remove(wl_resource_get_link(data)); } static void wl_compositor_create_surface(struct wl_client *client, -- cgit v1.2.3