This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Simplify foldEQ_utf8
authorKarl Williamson <khw@cpan.org>
Sat, 27 Dec 2014 01:31:04 +0000 (18:31 -0700)
committerKarl Williamson <khw@cpan.org>
Mon, 29 Dec 2014 20:52:57 +0000 (13:52 -0700)
commit1d39b2cd2a278ed0630f07bd7598726910eb6427
tree59d48fe2519a5f451e2e3019251508d016902bf5
parent357aaddece5471320c7b8b94099d29e9ee5c74fb
Simplify foldEQ_utf8

This moves the uncommon case of handling inputs under non-UTF-8 locales
out of this function to the functions it calls, which already have the
logic to handle it.  This simplifies this function, cutting a couple
branches each time through the loop from the common usage.

The locale handling is slowed down somewhat, but even if that were a
concern, another simpler function is normally used for locale handling.
This gets called only when one or both of the comparison strings is
UTF-8, which should be comparatively rare for non-UTF8 locales.
utf8.c