This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regexec.c: Avoid unnecessary calculation
authorKarl Williamson <public@khwilliamson.com>
Sun, 16 Sep 2012 16:51:01 +0000 (10:51 -0600)
committerKarl Williamson <public@khwilliamson.com>
Mon, 17 Sep 2012 04:31:23 +0000 (22:31 -0600)
commite6a3850e182c1d286b5e83a9f9917b7f0ddc4178
treefa3b9ffc53a0d223064192194979d6654446abb2
parent7b4252f49b5cd844c918f7f2cb81e064d4377ba9
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.
regexec.c