diff options
author | Karl Williamson <khw@cpan.org> | 2021-03-18 12:43:11 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2022-06-12 09:50:10 -0600 |
commit | af48e60e2d4b6381d124deb9441a532a0e9e6e88 (patch) | |
tree | cdd40fe09823d490724bf9412911d832e0fc9403 /handy.h | |
parent | 3f0486a381e33e966195a4eb64211e4e8aa2a32d (diff) | |
download | perl-af48e60e2d4b6381d124deb9441a532a0e9e6e88.tar.gz |
handy.h: Add some branch predictions
Diffstat (limited to 'handy.h')
-rw-r--r-- | handy.h | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1916,11 +1916,11 @@ END_EXTERN_C ? (c) \ : ((! IN_UTF8_CTYPE_LOCALE) \ ? (cast)function((cast)(c)) \ - : ((((U8)(c)) == MICRO_SIGN) \ + : (UNLIKELY(((U8)(c)) == MICRO_SIGN) \ ? GREEK_CAPITAL_LETTER_MU \ - : ((((U8)(c)) == LATIN_SMALL_LETTER_Y_WITH_DIAERESIS) \ + : (UNLIKELY(((U8)(c)) == LATIN_SMALL_LETTER_Y_WITH_DIAERESIS) \ ? LATIN_CAPITAL_LETTER_Y_WITH_DIAERESIS \ - : ((((U8)(c)) == LATIN_SMALL_LETTER_SHARP_S) \ + : (UNLIKELY(((U8)(c)) == LATIN_SMALL_LETTER_SHARP_S) \ ? (__ASSERT_(0) (c)) \ : PL_mod_latin1_uc[ (U8) (c) ]))))) @@ -1934,7 +1934,7 @@ END_EXTERN_C ((UNLIKELY((c) == MICRO_SIGN) && IN_UTF8_CTYPE_LOCALE) \ ? GREEK_SMALL_LETTER_MU \ : (__ASSERT_(! IN_UTF8_CTYPE_LOCALE \ - || (c) != LATIN_SMALL_LETTER_SHARP_S) \ + || LIKELY((c) != LATIN_SMALL_LETTER_SHARP_S)) \ generic_toLOWER_LC_(c, function, cast))) /* Use the libc versions for these if available. */ @@ -1959,8 +1959,8 @@ END_EXTERN_C * it gets. */ # define isCNTRL_LC(c) generic_LC_(c, _CC_CNTRL, iscntrl) # define isSPACE_LC(c) generic_LC_(c, _CC_SPACE, isspace) -# define isIDFIRST_LC(c) ((c) == '_' || isALPHA_LC(c)) -# define isWORDCHAR_LC(c) ((c) == '_' || isALPHANUMERIC_LC(c)) +# define isIDFIRST_LC(c) (UNLIKELY((c) == '_') || isALPHA_LC(c)) +# define isWORDCHAR_LC(c) (UNLIKELY((c) == '_') || isALPHANUMERIC_LC(c)) # define toLOWER_LC(c) generic_toLOWER_LC_((c), tolower, U8) # define toUPPER_LC(c) generic_toUPPER_LC_((c), toupper, U8) |