From 798ecb88d57e5ed7af24be62a52e6f0ccb87a7de Mon Sep 17 00:00:00 2001 From: Mathias Gumz Date: Thu, 24 Feb 2011 16:56:53 +0100 Subject: cache result of getWorkspace() --- src/Screen.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Screen.cc b/src/Screen.cc index e13c2c6..39bb966 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -1409,8 +1409,9 @@ void BScreen::reassociateWindow(FluxboxWindow *w, unsigned int wkspc_id, } else if (ignore_sticky || ! w->isStuck()) { // fresh windows have workspaceNumber == -1, which leads to // an invalid workspace (unsigned int) - if (getWorkspace(w->workspaceNumber())) - getWorkspace(w->workspaceNumber())->removeWindow(w, true); + Workspace* ws = getWorkspace(w->workspaceNumber()); + if (ws) + ws->removeWindow(w, true); getWorkspace(wkspc_id)->addWindow(*w); } } -- cgit v0.11.2