This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Refactor new charclass optimizations
authorKarl Williamson <public@khwilliamson.com>
Wed, 4 Jul 2012 20:16:29 +0000 (14:16 -0600)
committerKarl Williamson <public@khwilliamson.com>
Wed, 25 Jul 2012 03:13:44 +0000 (21:13 -0600)
commitc9f92f3e73ebbe666cd3bcf1a6177b6e7cdb84c3
treee19a9173e02122d8b7bcb7cd82c41d87339a5625
parent575a8a29f39b3d855395253b9ccab1549a4f1bf9
regcomp.c: Refactor new charclass optimizations

Commits 3a64b5154fffec75126d34d25954f0aef30d9f8a and
3172e3fd885a9c54105d3b6156f18dc761fe29e5 introduced some optimizations
into the handling of bracketed character classes with just a single
element.

In working on other optimizations, I realized that it would be better to
put these all in one spot, instead of doing things partially and setting
flags to pass to other areas of the routine.

This commit moves all the processing to a single spot, which gets called
only after we know that there will be just one element in the character
class.

I also realized that the [0-9] optimization should strictly not be done
under locale.  There is no test for this, as actually this would only be
a problem if a locale was in violation of the C standard.  But (most) of
the rest of Perl doesn't assume that locales are well-behaved in this
regard, so now this code doesn't either.
regcomp.c