From: Matthew Fernandez Date: Sun, 24 Jul 2022 17:49:39 +0000 (-0700) Subject: ast onematch: fuse comparison against 'xdigi' and 't' X-Git-Tag: 5.0.1~26^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=38863e9c78b7a23080806630950da5594fdb6de9;p=graphviz ast onematch: fuse comparison against 'xdigi' and 't' Freed of the limitations of hash function in the previous commit, we can express this as a single comparison. --- diff --git a/lib/ast/strmatch.c b/lib/ast/strmatch.c index c61182c49..5f440e797 100644 --- a/lib/ast/strmatch.c +++ b/lib/ast/strmatch.c @@ -424,8 +424,8 @@ onematch(Match_t * mp, int g, char *s, char *p, char *e, char *r, } else if (x == 5 && strncmp(oldp, "upper", 5) == 0) { if (icase ? islower(sc) : isupper(sc)) ok = 1; - } else if (x == 6 && strncmp(oldp, "xdigi", 5) == 0) { - if (oldp[5] == 't' && isxdigit(sc)) + } else if (x == 6 && strncmp(oldp, "xdigit", 6) == 0) { + if (isxdigit(sc)) ok = 1; } }