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.