From 726137b54cce68fcc6b29154c8dd4b58a2b1e4d9 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Sat, 3 May 2014 15:38:27 -0600 Subject: 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. --- regcharclass.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'regcharclass.h') 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]) ) ?\ -- cgit v1.2.1