This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
utf8.h: Add branch prediction
authorKarl Williamson <khw@cpan.org>
Sun, 12 Feb 2017 03:57:36 +0000 (20:57 -0700)
committerKarl Williamson <khw@cpan.org>
Sun, 12 Feb 2017 04:11:13 +0000 (21:11 -0700)
use bytes;

is unlikely to be the case.

utf8.h

diff --git a/utf8.h b/utf8.h
index 0fbe4b7..4f8ced3 100644 (file)
--- a/utf8.h
+++ b/utf8.h
@@ -707,7 +707,7 @@ with a ptr argument.
 /* A Unicode character can fold to up to 3 characters */
 #define UTF8_MAX_FOLD_CHAR_EXPAND 3
 
-#define IN_BYTES (CopHINTS_get(PL_curcop) & HINT_BYTES)
+#define IN_BYTES UNLIKELY(CopHINTS_get(PL_curcop) & HINT_BYTES)
 
 /*