aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2022-09-29 15:39:51 +0200
committerIgor Pashev <pashev.igor@gmail.com>2022-09-29 15:47:12 +0200
commit305b4c8815a99c51566b77c0d244eb09cd2420a5 (patch)
tree41c8db4ea032bdec3fc73f0a9aebf3b709051423
parent42d05c8a3f59f99daccaf65a117d183828446d71 (diff)
downloadmendeleev-305b4c8815a99c51566b77c0d244eb09cd2420a5.tar.gz
C: use a for-loop
-rw-r--r--mendeleev.c12
1 files 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;
}