Skip to content

Commit 935fddc

Browse files
committed
peep.c: Add some UNLIKELY()
It's also unlikely that the op_type will be any given value, but I expect the compiler and libc know that. This stresses that it is unlikely some module will customize the handling of these checkers.
1 parent adbdebe commit 935fddc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

peep.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2205,14 +2205,14 @@ S_maybe_multideref(pTHX_ OP *start, OP *orig_o, UV orig_action, U8 hints)
22052205
/* if a custom array/hash access checker is in scope,
22062206
* abandon optimisation attempt */
22072207
if ( (o->op_type == OP_AELEM || o->op_type == OP_HELEM)
2208-
&& PL_check[o->op_type] != PL_check[PERL_CK_NULL])
2208+
&& UNLIKELY(PL_check[o->op_type] != PL_check[PERL_CK_NULL]))
22092209
return;
22102210
/* similarly for customised exists and delete */
22112211
if ( (o->op_type == OP_EXISTS)
2212-
&& PL_check[o->op_type] != PL_check[PERL_CK_EXISTS])
2212+
&& UNLIKELY(PL_check[o->op_type] != PL_check[PERL_CK_EXISTS]))
22132213
return;
22142214
if ( (o->op_type == OP_DELETE)
2215-
&& PL_check[o->op_type] != PL_check[PERL_CK_DELETE])
2215+
&& UNLIKELY(PL_check[o->op_type] != PL_check[PERL_CK_DELETE]))
22162216
return;
22172217

22182218
if ( o->op_type != OP_AELEM

0 commit comments

Comments
 (0)