This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regexec.c: Avoid unnecessary calculation
When matching an EXACT node and the target string and the pattern differ
in utf8ness, the code prior to this patch calculated each code point from
the utf8 version in order to do the EXACT comparision with the non-utf8
version. But it is unnecessary to do this full calculation. Code
points above Latin1 cannot possibly match a non-UTF8 string; there is no
need to know precisely which code point it is in order to know that it
won't match. Similarly, invariant code points can be checked directly;
and the Latin1 variants can be downgraded for comparison by a simple
macro.