summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2011-09-24 12:05:25 -0600
committerKarl Williamson <public@khwilliamson.com>2011-10-01 09:58:08 -0600
commitbc39fe246af9f9dbbeef6550e5e5795ca2c366e5 (patch)
treeb0e4988e7684282b0b71ac2ef26d3f87f1f6189e /utf8.c
parent141d8bad68a083b9ce300cdc2e34549bd4240fe4 (diff)
downloadperl-bc39fe246af9f9dbbeef6550e5e5795ca2c366e5.tar.gz
No need for swashes for computing if ASCII
This information is trivially computed via the macro, no need to go out to disk and store a swash for this.
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/utf8.c b/utf8.c
index 57532cbd54..83cc3d111f 100644
--- a/utf8.c
+++ b/utf8.c
@@ -1236,9 +1236,7 @@ Perl_is_uni_alpha(pTHX_ UV c)
bool
Perl_is_uni_ascii(pTHX_ UV c)
{
- U8 tmpbuf[UTF8_MAXBYTES+1];
- uvchr_to_utf8(tmpbuf, c);
- return is_utf8_ascii(tmpbuf);
+ return isASCII(c);
}
bool
@@ -1554,7 +1552,9 @@ Perl_is_utf8_ascii(pTHX_ const U8 *p)
PERL_ARGS_ASSERT_IS_UTF8_ASCII;
- return is_utf8_common(p, &PL_utf8_ascii, "IsAscii");
+ /* ASCII characters are the same whether in utf8 or not. So the macro
+ * works on both utf8 and non-utf8 representations. */
+ return isASCII(*p);
}
bool