From: Karl Williamson Date: Fri, 6 Jan 2012 22:05:11 +0000 (-0700) Subject: regcomp.c: Compile inverted character classes with \p{} X-Git-Tag: accepted/trunk/20130322.191538~1202 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b6c46382308166d54090e3d8e385710664693ac0;p=platform%2Fupstream%2Fperl.git 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. --- 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 =