This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
utf8.c: Avoid some unnecessary work
authorKarl Williamson <khw@cpan.org>
Wed, 25 Jul 2018 01:52:25 +0000 (19:52 -0600)
committerKarl Williamson <khw@cpan.org>
Fri, 3 Aug 2018 19:13:24 +0000 (13:13 -0600)
commitb68ffe0ca77a6f503033bd7e2986911ed87efa80
tree962ef091d0cb9ca8209773d460b53dd2965f7d75
parenteb1f4bb4dd452c152bbada814043994f382907a2
utf8.c: Avoid some unnecessary work

The code changed by this commit used to check that the input was valid
UTF-8, and if so, calculated the code point, using a fast function
that doesn't do any error checking.

However, the changes earlier in 5.29 make the time spent in checking for
validity hardly less than the time spent in calculating the code point
at the same time.  So this commit switches to calculating the code point
from the start, avoiding a second pass through the byte string.
utf8.c