From 099b9de752f9cc212140533a8a2e20b31aa9028f Mon Sep 17 00:00:00 2001 From: Kirill Primak Date: Sun, 6 Nov 2022 13:54:24 +0300 Subject: compositor: drop role object NULL checks in handlers Instead, move the check to the caller. --- xwayland/xwm.c | 9 --------- 1 file changed, 9 deletions(-) (limited to 'xwayland') diff --git a/xwayland/xwm.c b/xwayland/xwm.c index 8f4c0ebb..3a3d35f2 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -824,9 +824,6 @@ static void read_surface_property(struct wlr_xwm *xwm, static void xwayland_surface_role_commit(struct wlr_surface *wlr_surface) { assert(wlr_surface->role == &xwayland_surface_role); struct wlr_xwayland_surface *surface = wlr_surface->role_data; - if (surface == NULL) { - return; - } if (!surface->mapped && wlr_surface_has_buffer(surface->surface)) { surface->mapped = true; @@ -839,9 +836,6 @@ static void xwayland_surface_role_precommit(struct wlr_surface *wlr_surface, const struct wlr_surface_state *state) { assert(wlr_surface->role == &xwayland_surface_role); struct wlr_xwayland_surface *surface = wlr_surface->role_data; - if (surface == NULL) { - return; - } if (state->committed & WLR_SURFACE_STATE_BUFFER && state->buffer == NULL) { // This is a NULL commit @@ -856,9 +850,6 @@ static void xwayland_surface_role_precommit(struct wlr_surface *wlr_surface, static void xwayland_surface_role_destroy(struct wlr_surface *wlr_surface) { assert(wlr_surface->role == &xwayland_surface_role); struct wlr_xwayland_surface *surface = wlr_surface->role_data; - if (surface == NULL) { - return; - } if (surface->mapped) { wl_signal_emit_mutable(&surface->events.unmap, surface); -- cgit v1.2.3