This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
utf8.c: Avoid unnecessary work xlating utf8 to uv
authorKarl Williamson <khw@cpan.org>
Thu, 28 Jun 2018 03:28:15 +0000 (21:28 -0600)
committerKarl Williamson <khw@cpan.org>
Thu, 5 Jul 2018 20:47:18 +0000 (14:47 -0600)
commit5af9f82224b62a56edca6981b8638328d12ba98a
tree1ec3857bd0e90e686c47728c3f1786c7ceb8bc8a
parent6c12993c67cedb7be68d2e7c7f52fbd9a39b92c8
utf8.c: Avoid unnecessary work xlating utf8 to uv

This moves the code for the dfa that does the translation of
non-problematic characters to earlier in the function to avoid work that
only needs to be done if the dfa rejects the input.  For example,
calculating how long the sequence is needed to be no longer is done
unless the dfa rejects.

Since the dfa always accepts an invariant if the allowed length is
non-zero, the code that tests for those specifically can be removed.
utf8.c