From 305b4c8815a99c51566b77c0d244eb09cd2420a5 Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Thu, 29 Sep 2022 15:39:51 +0200 Subject: C: use a for-loop --- mendeleev.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/mendeleev.c b/mendeleev.c index 81127dd..f6db8ea 100644 --- a/mendeleev.c +++ b/mendeleev.c @@ -151,15 +151,9 @@ explode (const char *word) return NULL; while (*formula->tail) - { - formula_t *f = formula; - while (f) - { - if (*f->tail) - advance (f); - f = f->next; - } - } + for (formula_t * f = formula; f; f = f->next) + if (*f->tail) + advance (f); return formula; } -- cgit v1.2.3