From: Mikko Rasa Date: Wed, 23 Dec 2015 06:49:34 +0000 (+0200) Subject: Add an early return to reorder_window X-Git-Url: http://git.tdb.fi/?p=geometrycompositor.git;a=commitdiff_plain Add an early return to reorder_window This avoids a linear search in case the window is already at the right position. --- diff --git a/source/main.c b/source/main.c index 34e05b1..43e130b 100644 --- a/source/main.c +++ b/source/main.c @@ -555,6 +555,9 @@ CompositedWindow *reorder_window(CompositedScreen *screen, CompositedWindow *win CompositedWindow hold; i = window-screen->windows; + if((i>0 && screen->windows[i-1].window==above) || (i==0 && !above)) + return window; + if(above) { for(j=0; jnwindows; ++j)