This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
sv_utf8_decode: Reverse order of tests for speed
authorKarl Williamson <khw@cpan.org>
Sat, 25 Nov 2017 04:56:09 +0000 (21:56 -0700)
committerKarl Williamson <khw@cpan.org>
Sat, 25 Nov 2017 05:10:52 +0000 (22:10 -0700)
commitbb1b88dd7be03975ef001e007081e75d83f8cb6f
tree797ea6decda2d6f184085b72a0f3caa0fb55225c
parent8cd29efcae02781bf1c9843e66b7b08105659d6b
sv_utf8_decode: Reverse order of tests for speed

Not that we have a fast is_utf8_invariant_string_loc(), use it first to
quickly find any variants.  Then use is_utf8_string() from then on.
This is the reverse order as to how it worked before this commit.  This
speeds things up two ways: 1) we use the faster function first, and 2)
use the information it returns to avoid reparsing the string starting at
the beginning.
sv.c