]> git.armaanb.net Git - dwm.git/commitdiff
applied Szabolcs proposal to simplify setlayout()
authorAnselm R. Garbe <arg@suckless.org>
Tue, 22 May 2007 09:29:04 +0000 (11:29 +0200)
committerAnselm R. Garbe <arg@suckless.org>
Tue, 22 May 2007 09:29:04 +0000 (11:29 +0200)
config.mk
layout.c

index aa90094ad0217f823567286e44c123c3f2fe0d45..de2fb006dfb37b8b4f504cd1f00533c39e56d625 100644 (file)
--- a/config.mk
+++ b/config.mk
@@ -1,5 +1,5 @@
 # dwm version
-VERSION = 4.1
+VERSION = 4.2
 
 # Customize below to fit your system
 
index bc5ca1c0df3a5af198e98e79f3a3162805014e2f..47e9e49f17a01fb8e5ff3f33b5bf7f6d5131f578 100644 (file)
--- a/layout.c
+++ b/layout.c
@@ -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);