applied Szabolcs proposal to simplify setlayout() 81658eaa
Anselm R. Garbe · 2007-05-22 11:29 2 file(s) · +4 −6
config.mk +1 −1
1 1
# dwm version
2 -
VERSION = 4.1
2 +
VERSION = 4.2
3 3
4 4
# Customize below to fit your system
5 5
layout.c +3 −5
198 198
	int i;
199 199
200 200
	if(!arg) {
201 -
		for(i = 0; i < nlayouts && lt != &layout[i]; i++);
202 -
		if(i == nlayouts - 1)
203 -
			lt = &layout[0];
204 -
		else
205 -
			lt = &layout[++i];
201 +
		lt++;
202 +
		if(lt == layout + nlayouts)
203 +
			lt = layout;
206 204
	}
207 205
	else {
208 206
		i = atoi(arg);