# HG changeset patch # User Anselm R Garbe # Date 1215079115 -3600 # Node ID 2c72f7c8826f67170df78ad1aef76587b7c4bff0 # Parent 5f55d9b819a2e4b620b76dd0b394244afd0799dc simplified detach() diff -r 5f55d9b819a2 -r 2c72f7c8826f dwm.c --- a/dwm.c Wed Jul 02 11:54:36 2008 +0100 +++ b/dwm.c Thu Jul 03 10:58:35 2008 +0100 @@ -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