From fa0174d248a8a6341401478131732bc04abb3951 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Fri, 20 Jul 2012 11:39:09 -0600 Subject: [PATCH] regcomp.c: Optimize /[[:blank:]]/u into \h These two are equivalent. --- regcomp.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/regcomp.c b/regcomp.c index 9c79400..fd2e735 100644 --- a/regcomp.c +++ b/regcomp.c @@ -11939,6 +11939,7 @@ parseit: invert = ! invert; /* FALLTHROUGH */ case ANYOF_HORIZWS: + is_horizws: op = (invert) ? NHORIZWS : HORIZWS; break; @@ -11952,6 +11953,14 @@ parseit: case ANYOF_MAX: break; + case ANYOF_NBLANK: + invert = ! invert; + /* FALLTHROUGH */ + case ANYOF_BLANK: + if (AT_LEAST_UNI_SEMANTICS && ! AT_LEAST_ASCII_RESTRICTED) { + goto is_horizws; + } + /* FALLTHROUGH */ default: /* A generic posix class. All the /a ones can be handled * by the POSIXA opcode. And all are closed under folding -- 2.7.4