diff options
author | Karl Williamson <public@khwilliamson.com> | 2011-09-24 12:05:25 -0600 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2011-10-01 09:58:08 -0600 |
commit | bc39fe246af9f9dbbeef6550e5e5795ca2c366e5 (patch) | |
tree | b0e4988e7684282b0b71ac2ef26d3f87f1f6189e /utf8.c | |
parent | 141d8bad68a083b9ce300cdc2e34549bd4240fe4 (diff) | |
download | perl-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.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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 |