diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2022-09-29 15:39:51 +0200 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2022-09-29 15:47:12 +0200 |
commit | 305b4c8815a99c51566b77c0d244eb09cd2420a5 (patch) | |
tree | 41c8db4ea032bdec3fc73f0a9aebf3b709051423 /mendeleev.c | |
parent | 42d05c8a3f59f99daccaf65a117d183828446d71 (diff) | |
download | mendeleev-305b4c8815a99c51566b77c0d244eb09cd2420a5.tar.gz |
C: use a for-loop
Diffstat (limited to 'mendeleev.c')
-rw-r--r-- | mendeleev.c | 12 |
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; } |