about summary refs log tree commit diff stats
path: root/dwm.c
diff options
context:
space:
mode:
authorAnselm R Garbe <garbeam@gmail.com>2008-07-03 10:58:35 +0100
committerAnselm R Garbe <garbeam@gmail.com>2008-07-03 10:58:35 +0100
commitf529d41ca1792455bbae29e008af3c27c3a49df5 (patch)
tree707019ac37c89301a1df18753a26bf9023c202fe /dwm.c
parent45768ee04bfab45a5dfd21105419806422ca8954 (diff)
downloaddwm-f529d41ca1792455bbae29e008af3c27c3a49df5.tar.gz
simplified detach()
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/dwm.c b/dwm.c
index 1554a16..3d9a063 100644
--- a/dwm.c
+++ b/dwm.c
@@ -459,16 +459,10 @@ destroynotify(XEvent *e) {
 
 void
 detach(Client *c) {
-	Client *i;
+	Client **tc;
 
-	if (c != clients) {
-		for(i = clients; i->next != c; i = i->next);
-		i->next = c->next;
-	}
-	else {
-		clients = c->next;
-	}
-	c->next =  NULL;
+	for(tc = &clients; *tc && *tc != c; tc = &(*tc)->next);
+	*tc = c->next;
 }
 
 void