home · contact · privacy
Slightly re-structured and re-styled a for-loop for greater understandability.
authorChristian Heller <c.heller@plomlompom.de>
Tue, 30 Jul 2013 01:38:35 +0000 (03:38 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Tue, 30 Jul 2013 01:38:35 +0000 (03:38 +0200)
src/windows.c

index 46124c5639a8b4c0b984e274adc573d5aa4bf235..362e10a475a3063a463ab3ce4fdb1e7d26ef24c9 100644 (file)
@@ -438,11 +438,11 @@ extern void shift_active_win(struct WinMeta * wmeta, char dir)
 
         /* Suspend all visible windows. */
         uint16_t i, i_max;
-        for (i_max = 1, w_p = wmeta->chain_start;
+        for (w_p = wmeta->chain_start, i_max = 1;
              w_p != wmeta->chain_end;
-             i_max++)
+             w_p = w_p->next)
         {
-            w_p = w_p->next;
+            i_max++;
         }
         struct Win ** wins = malloc(i_max * sizeof(struct Win *));
         for (i = 0, w_p = wmeta->chain_start; i < i_max; i++)