From 4bed8d14d77e5c66a5f635cc730c3458a1a292a5 Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Sun, 7 Dec 2014 17:10:16 +0100 Subject: [PATCH] wmaker: remove unnecessary null pointer checks in handle_event of wsmap The function is called only if wsmap is not null, and the function is not modifying its value so it won't become null. Removed the checks to keep the code as simple as possible for maintainability. Signed-off-by: Christophe CURIS --- src/wsmap.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/wsmap.c b/src/wsmap.c index ee667f9f..bc7a2ff1 100755 --- a/src/wsmap.c +++ b/src/wsmap.c @@ -487,8 +487,6 @@ static void handle_event(WWorkspaceMap *wsmap, W_WorkspaceMap *wsmap_array) WMMaskEvent(dpy, KeyPressMask | KeyReleaseMask | ExposureMask | PointerMotionMask | ButtonPressMask | ButtonReleaseMask | EnterWindowMask, &ev); - if (!wsmap) - break; modifiers = ev.xkey.state & w_global.shortcut.modifiers_mask; switch (ev.type) { @@ -539,8 +537,7 @@ static void handle_event(WWorkspaceMap *wsmap, W_WorkspaceMap *wsmap_array) XUngrabPointer(dpy, CurrentTime); XUngrabKeyboard(dpy, CurrentTime); - if (wsmap) - workspace_map_destroy(wsmap); + workspace_map_destroy(wsmap); } static WWorkspaceMap *init_workspace_map(WScreen *scr, W_WorkspaceMap *wsmap_array)