summaryrefslogtreecommitdiff
path: root/handy.h
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2011-09-24 13:23:21 -0600
committerKarl Williamson <public@khwilliamson.com>2011-10-01 09:58:08 -0600
commit7b952154426e53253db1065e8e73307cafb4c28b (patch)
tree961df07252889efbbd02fc2dc53cfbfec06aad78 /handy.h
parenta34094a9f21d9970be58b6482fe6e3245019558e (diff)
downloadperl-7b952154426e53253db1065e8e73307cafb4c28b.tar.gz
Don't use swash to find cntrls
Unicode stability policy guarantees that no code points will ever be added to the control characters beyond those already in it. All such characters are in the Latin1 range, and so the Perl core already knows which ones those are, and so there is no need to go out to disk and create a swash for these.
Diffstat (limited to 'handy.h')
-rw-r--r--handy.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/handy.h b/handy.h
index 2cd4a1386c..0247728e4d 100644
--- a/handy.h
+++ b/handy.h
@@ -867,7 +867,8 @@ EXTCONST U32 PL_charclass[];
#define isUPPER_uni(c) is_uni_upper(c)
#define isLOWER_uni(c) is_uni_lower(c)
#define isASCII_uni(c) isASCII(c)
-#define isCNTRL_uni(c) is_uni_cntrl(c)
+/* All controls are in Latin1 */
+#define isCNTRL_uni(c) ((c) < 256 ? isCNTRL_L1(c) : 0)
#define isGRAPH_uni(c) is_uni_graph(c)
#define isPRINT_uni(c) is_uni_print(c)
#define isPUNCT_uni(c) is_uni_punct(c)