Skip to content

Commit 30b299b

Browse files
committed
peep.c: Use constant when known over runtime
I imagine most compilers would know to optimize the reference away when the first conditional has ruled out all but one possibility, but I think it is clearer anyway to use that single value.
1 parent 658f070 commit 30b299b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

peep.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2211,12 +2211,12 @@ S_maybe_multideref(pTHX_ OP *start, OP *orig_o, UV orig_action, U8 hints)
22112211
return;
22122212
/* similarly for customised exists and delete */
22132213
if ( (o->op_type == OP_EXISTS)
2214-
&& PL_check[o->op_type] != Perl_ck_exists
2215-
&& PL_check[o->op_type] != PL_check[PERL_CK_EXISTS])
2214+
&& PL_check[OP_EXISTS] != Perl_ck_exists
2215+
&& PL_check[OP_EXISTS] != PL_check[PERL_CK_EXISTS])
22162216
return;
22172217
if ( (o->op_type == OP_DELETE)
2218-
&& PL_check[o->op_type] != Perl_ck_delete
2219-
&& PL_check[o->op_type] != PL_check[PERL_CK_DELETE])
2218+
&& PL_check[OP_DELETE] != Perl_ck_delete
2219+
&& PL_check[OP_DELETE] != PL_check[PERL_CK_DELETE])
22202220
return;
22212221

22222222
if ( o->op_type != OP_AELEM

0 commit comments

Comments
 (0)