summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2011-11-08 22:05:25 -0700
committerKarl Williamson <public@khwilliamson.com>2011-11-08 22:38:38 -0700
commit968c5e6ab01546e5aa0c2cb7fbb1c06a7c99b6af (patch)
tree3074ae2587bb36ebb204d4f5a263f0ec3b7749b8 /utf8.c
parentafc16117342e69d725e9609816ad29f611edb5a5 (diff)
downloadperl-968c5e6ab01546e5aa0c2cb7fbb1c06a7c99b6af.tar.gz
utf8.c: Expand use of refactored to_uni_lower
The new function split out from to_uni_lower is now called when appropriate from to_utf8_lower. And to_uni_lower no longer calls to_utf8_lower, using the macro instead, saving a function call and duplicate work
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/utf8.c b/utf8.c
index 919d1ccc85..8c87d2156a 100644
--- a/utf8.c
+++ b/utf8.c
@@ -1383,6 +1383,8 @@ S_to_lower_latin1(pTHX_ const U8 c, U8* p, STRLEN *lenp)
UV
Perl_to_uni_lower(pTHX_ UV c, U8* p, STRLEN *lenp)
{
+ dVAR;
+
PERL_ARGS_ASSERT_TO_UNI_LOWER;
if (c < 256) {
@@ -1390,7 +1392,7 @@ Perl_to_uni_lower(pTHX_ UV c, U8* p, STRLEN *lenp)
}
uvchr_to_utf8(p, c);
- return to_utf8_lower(p, p, lenp);
+ return CALL_LOWER_CASE(p, p, lenp);
}
UV
@@ -2065,6 +2067,13 @@ Perl_to_utf8_lower(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp)
PERL_ARGS_ASSERT_TO_UTF8_LOWER;
+ if (UTF8_IS_INVARIANT(*p)) {
+ return to_lower_latin1(*p, ustrp, lenp);
+ }
+ else if UTF8_IS_DOWNGRADEABLE_START(*p) {
+ return to_lower_latin1(TWO_BYTE_UTF8_TO_UNI(*p, *(p+1)), ustrp, lenp);
+ }
+
return CALL_LOWER_CASE(p, ustrp, lenp);
}