From 0bd14905e612391c672edf3787194ce894727178 Mon Sep 17 00:00:00 2001 From: okan Date: Wed, 7 Nov 2012 21:01:48 +0000 Subject: now that we have FOREACH_SAFE queue macros, use them where appropriate; from Tiago Cunha. --- conf.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'conf.c') diff --git a/conf.c b/conf.c index 196ade3..25813ad 100644 --- a/conf.c +++ b/conf.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: conf.c,v 1.104 2012/11/07 20:37:55 okan Exp $ + * $OpenBSD: conf.c,v 1.105 2012/11/07 21:01:48 okan Exp $ */ #include @@ -512,10 +512,7 @@ conf_unbind(struct conf *c, struct keybinding *unbind) { struct keybinding *key = NULL, *keynxt; - for (key = TAILQ_FIRST(&c->keybindingq); - key != TAILQ_END(&c->keybindingq); key = keynxt) { - keynxt = TAILQ_NEXT(key, entry); - + TAILQ_FOREACH_SAFE(key, &c->keybindingq, entry, keynxt) { if (key->modmask != unbind->modmask) continue; @@ -597,10 +594,7 @@ conf_mouseunbind(struct conf *c, struct mousebinding *unbind) { struct mousebinding *mb = NULL, *mbnxt; - for (mb = TAILQ_FIRST(&c->mousebindingq); - mb != TAILQ_END(&c->mousebindingq); mb = mbnxt) { - mbnxt = TAILQ_NEXT(mb, entry); - + TAILQ_FOREACH_SAFE(mb, &c->mousebindingq, entry, mbnxt) { if (mb->modmask != unbind->modmask) continue; -- cgit v1.2.3-2-gb3c3