From: Matthew Fernandez Date: Tue, 19 Jul 2022 02:42:42 +0000 (-0700) Subject: expr extoken_fn: simplify hex parsing loop X-Git-Tag: 5.0.1~30^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bd2d36473e0120cbd332cacd8f84bec18bc55075;p=graphviz expr extoken_fn: simplify hex parsing loop --- diff --git a/lib/expr/extoken.c b/lib/expr/extoken.c index 2764fd3e9..ed0ba6d6d 100644 --- a/lib/expr/extoken.c +++ b/lib/expr/extoken.c @@ -16,7 +16,7 @@ */ #include "config.h" - +#include #include #include #include @@ -548,18 +548,9 @@ extoken_fn(Expr_t* ex) { b = 16; sfputc(ex->tmp, c); - for (;;) + for (c = lex(ex); isxdigit(c); c = lex(ex)) { - switch (c = lex(ex)) - { - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': - case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': - sfputc(ex->tmp, c); - continue; - } - break; + sfputc(ex->tmp, c); } } else