simplification of view() as proposed by anydot
c094ed24
1 file(s) · +3 −10
| 1828 | 1828 | ||
| 1829 | 1829 | void |
|
| 1830 | 1830 | view(const char *arg) { |
|
| 1831 | - | Bool tmp[LENGTH(tags)]; |
|
| 1832 | - | unsigned int i; |
|
| 1833 | - | ||
| 1834 | - | for(i = 0; i < LENGTH(tags); i++) |
|
| 1835 | - | tmp[i] = (NULL == arg); |
|
| 1836 | - | tmp[idxoftag(arg)] = True; |
|
| 1837 | - | ||
| 1838 | - | seltags ^= 1; /* toggle sel tagset */ |
|
| 1839 | - | if(memcmp(tagset[seltags ^ 1], tmp, TAGSZ) != 0) |
|
| 1840 | - | memcpy(tagset[seltags], tmp, TAGSZ); |
|
| 1831 | + | seltags ^= 1; |
|
| 1832 | + | memset(tagset[seltags], (NULL == arg), TAGSZ); |
|
| 1833 | + | tagset[seltags][idxoftag(arg)] = True; |
|
| 1841 | 1834 | arrange(); |
|
| 1842 | 1835 | } |
|
| 1843 | 1836 |