diff options
author | Karl Williamson <public@khwilliamson.com> | 2012-06-06 15:40:38 -0600 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2012-06-07 09:55:50 -0600 |
commit | dd9267d7ed4287d573abd56d1aadf2152c628baf (patch) | |
tree | fcdc1400ff4f0e26868fb9e88c6ad5594b37bcdf /utf8.c | |
parent | 2114036ce68685bad99e2d43873afa0ff512b0a6 (diff) | |
download | perl-dd9267d7ed4287d573abd56d1aadf2152c628baf.tar.gz |
utf8.c: Avoid some extra work
In the case changed, the output is the input, so can just Copy it
instead of re-deriving it.
Diffstat (limited to 'utf8.c')
-rw-r--r-- | utf8.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -2419,9 +2419,11 @@ Perl_to_utf8_case(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp, } } - if (!len) /* Neither: just copy. In other words, there was no mapping - defined, which means that the code point maps to itself */ - len = uvchr_to_utf8(ustrp, uv0) - ustrp; + if (!len) { /* There was no mapping defined, which means that the code + point maps to itself */ + len = UTF8SKIP(p); + Copy(p, ustrp, len, U8); + } if (lenp) *lenp = len; |