This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2114036
)
utf8.c: Avoid some extra work
author
Karl Williamson
<public@khwilliamson.com>
Wed, 6 Jun 2012 21:40:38 +0000
(15:40 -0600)
committer
Karl Williamson
<public@khwilliamson.com>
Thu, 7 Jun 2012 15:55:50 +0000
(09:55 -0600)
In the case changed, the output is the input, so can just Copy it
instead of re-deriving it.
utf8.c
patch
|
blob
|
blame
|
history
diff --git
a/utf8.c
b/utf8.c
index
5359110
..
5469a8e
100644
(file)
--- a/
utf8.c
+++ b/
utf8.c
@@
-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;