diff options
author | Karl Williamson <public@khwilliamson.com> | 2011-09-28 15:07:18 -0600 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2011-10-01 09:58:10 -0600 |
commit | 20df05f4ef2efadbaa1ffaf5267b7ad0180a7804 (patch) | |
tree | a8b085dc7d11ad133a6155b5cc17854b007f4c9b /utf8.h | |
parent | 7049214e3eea022e77794ed9b9d9038f93695ef9 (diff) | |
download | perl-20df05f4ef2efadbaa1ffaf5267b7ad0180a7804.tar.gz |
utf8.h: Remove redundant checks
The macros that these call have been revised to do the same checks,
enhanced to not call the functions for all of Latin1, not just ASCII as
these did. So the tests here are redundant.
Diffstat (limited to 'utf8.h')
-rw-r--r-- | utf8.h | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -201,15 +201,16 @@ Perl's extended UTF-8 means we can have start bytes up to FF. #define UTF8_EIGHT_BIT_LO(c) UTF8_TWO_BYTE_LO((U8)(c)) /* - * Note: we try to be careful never to call the isXXX_utf8() functions - * unless we're pretty sure we've seen the beginning of a UTF-8 or UTFEBCDIC - * character. Otherwise we risk loading in the heavy-duty swash_init and - * swash_fetch routines unnecessarily. + * 'c' is whether or not p is encoded in UTF8. The names 'foo_lazy_if' stem + * from an earlier version of these macros in which they didn't call the + * foo_utf8() macros (i.e. were 'lazy') unless they decided that *p is the + * beginning of a utf8 character. Now that foo_utf8() determines that itself, + * no need to do it again here */ -#define isIDFIRST_lazy_if(p,c) ((IN_BYTES || (!c || ! UTF8_IS_START(*((const U8*)p)))) \ +#define isIDFIRST_lazy_if(p,c) ((IN_BYTES || !c ) \ ? isIDFIRST(*(p)) \ : isIDFIRST_utf8((const U8*)p)) -#define isALNUM_lazy_if(p,c) ((IN_BYTES || (!c || ! UTF8_IS_START(*((const U8*)p)))) \ +#define isALNUM_lazy_if(p,c) ((IN_BYTES || (!c )) \ ? isALNUM(*(p)) \ : isALNUM_utf8((const U8*)p)) |