This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pp.c: Add compiler hint
authorKarl Williamson <public@khwilliamson.com>
Fri, 11 Nov 2011 17:22:48 +0000 (10:22 -0700)
committerKarl Williamson <public@khwilliamson.com>
Fri, 11 Nov 2011 20:30:59 +0000 (13:30 -0700)
Almost always the input to uc() will be one of the other 253 Latin1
characters rather than one of the three that gets here.

pp.c

diff --git a/pp.c b/pp.c
index 5707ced..12e69e4 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -3953,7 +3953,7 @@ PP(pp_uc)
            else {
                for (; s < send; d++, s++) {
                    *d = toUPPER_LATIN1_MOD(*s);
-                   if (*d != LATIN_SMALL_LETTER_Y_WITH_DIAERESIS) continue;
+                   if (LIKELY(*d != LATIN_SMALL_LETTER_Y_WITH_DIAERESIS)) continue;
 
                    /* The mainstream case is the tight loop above.  To avoid
                     * extra tests in that, all three characters that require