code-style: simplify some checks
commit5e76e7e21da042c493c59235ca82d7275f20a7e4
authorNRK <nrk@disroot.org>
Fri, 5 Aug 2022 22:27:13 +0000 (6 04:27 +0600)
committerHiltjo Posthuma <hiltjo@codemadness.org>
Sat, 6 Aug 2022 14:09:01 +0000 (6 16:09 +0200)
treeec24d53824887428d186c7d38776f155ebc9b892
parent5b2e5e7a4001479e4dc3e245f96e49f7ea0da658
code-style: simplify some checks

main change here is making the `zoom()` logic saner. the rest of the
changes are just small stuff which accumulated on my local branch.

pop() must not be called with NULL. and `zoom()` achieves this, but in a
very (unnecessarily) complicated way:

if c == NULL then nexttiled() will return NULL as well, so we enter this
branch:

if (c == nexttiled(selmon->clients))

in here the !c check fails and the function returns before calling pop()

if (!c || !(c = nexttiled(c->next)))
return;

however, none of this was needed. we can simply return early if c was NULL.
Also `c` is set to `selmon->sel` so we can use `c` in the first check
instead which makes things shorter.
dwm.c