This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
utf8.c: Add compiler hint
authorKarl Williamson <public@khwilliamson.com>
Fri, 11 Nov 2011 16:29:09 +0000 (09:29 -0700)
committerKarl Williamson <public@khwilliamson.com>
Fri, 11 Nov 2011 16:43:58 +0000 (09:43 -0700)
It's very rare that someone will be outputting these unusual code points

utf8.c

diff --git a/utf8.c b/utf8.c
index 1e6f1a7..b873578 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -3393,7 +3393,7 @@ Perl_check_utf8_print(pTHX_ register const U8* s, const STRLEN len)
                           "%s in %s", unees, PL_op ? OP_DESC(PL_op) : "print");
            return FALSE;
        }
                           "%s in %s", unees, PL_op ? OP_DESC(PL_op) : "print");
            return FALSE;
        }
-       if (*s >= UTF8_FIRST_PROBLEMATIC_CODE_POINT_FIRST_BYTE) {
+       if (UNLIKELY(*s >= UTF8_FIRST_PROBLEMATIC_CODE_POINT_FIRST_BYTE)) {
            STRLEN char_len;
            if (UTF8_IS_SUPER(s)) {
                if (ckWARN_d(WARN_NON_UNICODE)) {
            STRLEN char_len;
            if (UTF8_IS_SUPER(s)) {
                if (ckWARN_d(WARN_NON_UNICODE)) {