applied Szabolcs proposal to simplify setlayout()
authorAnselm R. Garbe <arg@suckless.org>
Tue, 22 May 2007 11:29:04 +0200
changeset 891 b940ac76c22f
parent 890 3ece6b5b9647
child 892 42bf8e618d52
applied Szabolcs proposal to simplify setlayout()
config.mk
layout.c
--- 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
 
--- 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 @@
 	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);