simplified detach()
Anselm R Garbe garbeam@gmail.com
Thu, 03 Jul 2008 10:58:35 +0100
1 files changed,
3 insertions(+),
9 deletions(-)
jump to
M
dwm.c
→
dwm.c
@@ -459,16 +459,10 @@ }
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