# HG changeset patch # User Anselm R Garbe # Date 1209317771 -3600 # Node ID e6b4b21680be623e65bdb2ba6292119c549614ab # Parent bf63402f3b3302fe1332d531d9c7f5b9e0d1ce87 simplification of view() as proposed by anydot diff -r bf63402f3b33 -r e6b4b21680be dwm.c --- a/dwm.c Sun Apr 27 18:33:31 2008 +0100 +++ b/dwm.c Sun Apr 27 18:36:11 2008 +0100 @@ -1828,16 +1828,9 @@ void view(const char *arg) { - Bool tmp[LENGTH(tags)]; - unsigned int i; - - for(i = 0; i < LENGTH(tags); i++) - tmp[i] = (NULL == arg); - tmp[idxoftag(arg)] = True; - - seltags ^= 1; /* toggle sel tagset */ - if(memcmp(tagset[seltags ^ 1], tmp, TAGSZ) != 0) - memcpy(tagset[seltags], tmp, TAGSZ); + seltags ^= 1; + memset(tagset[seltags], (NULL == arg), TAGSZ); + tagset[seltags][idxoftag(arg)] = True; arrange(); }