summaryrefslogtreecommitdiff
path: root/regcharclass.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2014-05-03 15:38:27 -0600
committerKarl Williamson <khw@cpan.org>2014-05-30 16:11:28 -0600
commit726137b54cce68fcc6b29154c8dd4b58a2b1e4d9 (patch)
treeb8a073959d46ac4f44e9760060445147c3e2b52c /regcharclass.h
parentb94eb3d40b0d2ecf5510a08ef19e565105f6f7fe (diff)
downloadperl-726137b54cce68fcc6b29154c8dd4b58a2b1e4d9.tar.gz
regen/regcharclass.pl: Improve the generated code
This is a small improvement when a consecutive group of U8 code points begins at 0 or ends at 255. These end points are physically impossible of being exceeded, so there is no need to test for that end of the range. In several places this causes a mask operation to not be generated.
Diffstat (limited to 'regcharclass.h')
-rw-r--r--regcharclass.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/regcharclass.h b/regcharclass.h
index 5b04492b0f..f7ca75843e 100644
--- a/regcharclass.h
+++ b/regcharclass.h
@@ -647,7 +647,7 @@
*/
/*** GENERATED CODE ***/
#define is_PROBLEMATIC_LOCALE_FOLD_utf8(s) \
-( ( ( NATIVE_TO_LATIN1(((U8*)s)[0]) & 0x80 ) == 0x00 ) ? 1 \
+( ( NATIVE_TO_LATIN1(((U8*)s)[0]) <= 0x7F ) ? 1 \
: ( ( NATIVE_TO_LATIN1(((U8*)s)[0]) & 0xFE ) == 0xC2 ) ? \
2 \
: ( 0xC4 == NATIVE_TO_LATIN1(((U8*)s)[0]) || 0xC7 == NATIVE_TO_LATIN1(((U8*)s)[0]) ) ?\
@@ -684,7 +684,7 @@
*/
/*** GENERATED CODE ***/
#define is_PROBLEMATIC_LOCALE_FOLDEDS_START_utf8(s) \
-( ( ( NATIVE_TO_LATIN1(((U8*)s)[0]) & 0x80 ) == 0x00 ) ? 1 \
+( ( NATIVE_TO_LATIN1(((U8*)s)[0]) <= 0x7F ) ? 1 \
: ( ( NATIVE_TO_LATIN1(((U8*)s)[0]) & 0xFE ) == 0xC2 ) ? \
2 \
: ( 0xC4 == NATIVE_TO_LATIN1(((U8*)s)[0]) || 0xC7 == NATIVE_TO_LATIN1(((U8*)s)[0]) ) ?\