diff options
author | Karl Williamson <khw@cpan.org> | 2019-01-29 22:02:59 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2019-02-04 21:00:50 -0700 |
commit | df7d4938c6907db4b8030fd133ca9d55e1e44a0d (patch) | |
tree | 52060e1a3b077a1a0a5ff302c4f6a78cdd6d0372 /pp.c | |
parent | f4cd1cd9e8d271b135a75b4b6fd817fa758c112a (diff) | |
download | perl-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.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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)); } |