summaryrefslogtreecommitdiff
path: root/handy.h
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2011-09-24 11:56:40 -0600
committerKarl Williamson <public@khwilliamson.com>2011-10-01 09:58:08 -0600
commit141d8bad68a083b9ce300cdc2e34549bd4240fe4 (patch)
tree6320723cd7e6e8e93165182da341c5b994f76407 /handy.h
parent41f43cc22340d382ce3bf1249a2521a4ec5285a8 (diff)
downloadperl-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.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/handy.h b/handy.h
index 1f78e963a4..2cd4a1386c 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)