summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2019-01-29 22:02:59 -0700
committerKarl Williamson <khw@cpan.org>2019-02-04 21:00:50 -0700
commitdf7d4938c6907db4b8030fd133ca9d55e1e44a0d (patch)
tree52060e1a3b077a1a0a5ff302c4f6a78cdd6d0372 /pp.c
parentf4cd1cd9e8d271b135a75b4b6fd817fa758c112a (diff)
downloadperl-df7d4938c6907db4b8030fd133ca9d55e1e44a0d.tar.gz
pp.c: Use faster method to convert to UTF-8
There is a special inline function that's used when converting a single byte to UTF-8, that is faster than the more general one used prior to this commit.
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/pp.c b/pp.c
index cde8fa51f7..ecb31379f4 100644
--- a/pp.c
+++ b/pp.c
@@ -3895,9 +3895,11 @@ PP(pp_ucfirst)
*d++ = *(tmpbuf + 1);
s++; /* We have just processed the 1st char */
- for (; s < send; s++) {
- d = uvchr_to_utf8(d, *s);
- }
+ while (s < send) {
+ append_utf8_from_native_byte(*s, &d);
+ s++;
+ }
+
*d = '\0';
SvCUR_set(dest, d - (U8*)SvPVX_const(dest));
}