[hackers] [dwm] applied Szabolcs proposal to simplify setlayout()

From: Anselm R. Garbe <arg_AT_suckless.org>
Date: Tue May 22 11:33:36 2007

changeset: 891:b940ac76c22f
user: Anselm R. Garbe <arg_AT_suckless.org>
date: Tue May 22 11:29:04 2007 +0200
summary: applied Szabolcs proposal to simplify setlayout()

diff -r 3ece6b5b9647 -r b940ac76c22f config.mk
--- a/config.mk Mon May 21 14:37:26 2007 +0200
+++ b/config.mk Tue May 22 11:29:04 2007 +0200
@@ -1,5 +1,5 @@
 # dwm version
-VERSION = 4.1
+VERSION = 4.2
 
 # Customize below to fit your system
 
diff -r 3ece6b5b9647 -r b940ac76c22f layout.c
--- a/layout.c Mon May 21 14:37:26 2007 +0200
+++ b/layout.c Tue May 22 11:29:04 2007 +0200
@@ -198,11 +198,9 @@ setlayout(const char *arg) {
         int i;
 
         if(!arg) {
- for(i = 0; i < nlayouts && lt != &layout[i]; i++);
- if(i == nlayouts - 1)
- lt = &layout[0];
- else
- lt = &layout[++i];
+ lt++;
+ if(lt == layout + nlayouts)
+ lt = layout;
         }
         else {
                 i = atoi(arg);
Received on Tue May 22 2007 - 11:33:36 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:56:45 UTC