From bd2d36473e0120cbd332cacd8f84bec18bc55075 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Mon, 18 Jul 2022 19:42:42 -0700 Subject: [PATCH] expr extoken_fn: simplify hex parsing loop --- lib/expr/extoken.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) 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 -- 2.40.0