diff options
author | Karl Williamson <public@khwilliamson.com> | 2011-09-24 11:56:40 -0600 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2011-10-01 09:58:08 -0600 |
commit | 141d8bad68a083b9ce300cdc2e34549bd4240fe4 (patch) | |
tree | 6320723cd7e6e8e93165182da341c5b994f76407 /handy.h | |
parent | 41f43cc22340d382ce3bf1249a2521a4ec5285a8 (diff) | |
download | perl-141d8bad68a083b9ce300cdc2e34549bd4240fe4.tar.gz |
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.
Diffstat (limited to 'handy.h')
-rw-r--r-- | handy.h | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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) |