From 141d8bad68a083b9ce300cdc2e34549bd4240fe4 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Sat, 24 Sep 2011 11:56:40 -0600 Subject: [PATCH] handy.h: No need to call fcns to compute if ASCII Only the characters whose ordinals are 0-127 are ASCII. This is trivially computed by the macro, so no need to call is_uni_ascii() to do this. Also, since ASCII characters are the same when represented in utf8 or not, the utf8 function call is also superfluous. --- handy.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/handy.h b/handy.h index 1f78e96..2cd4a13 100644 --- a/handy.h +++ b/handy.h @@ -866,7 +866,7 @@ EXTCONST U32 PL_charclass[]; #define isDIGIT_uni(c) is_uni_digit(c) #define isUPPER_uni(c) is_uni_upper(c) #define isLOWER_uni(c) is_uni_lower(c) -#define isASCII_uni(c) is_uni_ascii(c) +#define isASCII_uni(c) isASCII(c) #define isCNTRL_uni(c) is_uni_cntrl(c) #define isGRAPH_uni(c) is_uni_graph(c) #define isPRINT_uni(c) is_uni_print(c) @@ -908,7 +908,8 @@ EXTCONST U32 PL_charclass[]; #define isDIGIT_utf8(p) is_utf8_digit(p) #define isUPPER_utf8(p) is_utf8_upper(p) #define isLOWER_utf8(p) is_utf8_lower(p) -#define isASCII_utf8(p) is_utf8_ascii(p) +/* Because ASCII is invariant under utf8, the non-utf8 macro works */ +#define isASCII_utf8(p) isASCII(p) #define isCNTRL_utf8(p) is_utf8_cntrl(p) #define isGRAPH_utf8(p) is_utf8_graph(p) #define isPRINT_utf8(p) is_utf8_print(p) -- 2.7.4