From b6c46382308166d54090e3d8e385710664693ac0 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Fri, 6 Jan 2012 15:05:11 -0700 Subject: [PATCH] regcomp.c: Compile inverted character classes with \p{} This commit causes character classes of the form [^\p{...}] to have their code points known at compile time instead of runtime. This allows for better optimization and runtime execution speed. --- regcomp.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/regcomp.c b/regcomp.c index 812b40a..6e7bb3e 100644 --- a/regcomp.c +++ b/regcomp.c @@ -10299,7 +10299,6 @@ parseit: /* Look up the property name, and get its swash and * inversion list, if the property is found */ - if (! (ANYOF_FLAGS(ret) & ANYOF_INVERT)) { if (swash) { SvREFCNT_dec(swash); } @@ -10310,10 +10309,7 @@ parseit: undefined properties */ NULL, FALSE /* No inversion list */ ); - } - - if ( ANYOF_FLAGS(ret) & ANYOF_INVERT - || ! swash + if ( ! swash || ! SvROK(swash) || ! SvTYPE(SvRV(swash)) == SVt_PVHV || ! (invlistsvp = -- 2.7.4