From 20df05f4ef2efadbaa1ffaf5267b7ad0180a7804 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Wed, 28 Sep 2011 15:07:18 -0600 Subject: 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. --- utf8.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'utf8.h') diff --git a/utf8.h b/utf8.h index c40fb5883e..b83ddef825 100644 --- a/utf8.h +++ b/utf8.h @@ -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)) -- cgit v1.2.1