On 23 April 2017 at 20:14, Hiltjo Posthuma <[email protected]> wrote: > On Sun, Apr 23, 2017 at 11:54:31PM +1000, Daniel Cousens wrote: >> I have found this pattern to take up significant parts of my time when >> rebasing my changes onto suckless/master, Â such that I feel the >> following patch will both increase readability, Â reduce diffs and >> overall increase code quality :). >> Thoughts? > >> From 160dbe6eaa8fccc1eb5c9cde036b9256c2e820c5 Mon Sep 17 00:00:00 2001 >> From: Daniel Cousens <[email protected]> >> Date: Sun, 23 Apr 2017 18:46:47 +1000 >> Subject: [PATCH] use canarrange over sellmon->sellt repeated pattern >> >> --- >> dwm.c | 28 ++++++++++++++++------------ >> 1 file changed, 16 insertions(+), 12 deletions(-) >> >> diff --git a/dwm.c b/dwm.c >> index 7861512..fdea9e2 100644 >> --- a/dwm.c >> +++ b/dwm.c >> @@ -235,6 +235,10 @@ static int xerrordummy(Display *dpy, XErrorEvent *ee); >> static int xerrorstart(Display *dpy, XErrorEvent *ee); >> static void zoom(const Arg *arg); >> >> +int canarrange (Monitor* m) { >> + return m->lt[m->sellt]->arrange != NULL; >> +} >> +
I'd prefer a define instead of a one-line function. -Anselm
