Skip to content

Commit 41c8453

Browse files
committed
op.c: Collapse duplicate macro calls
Instead, store the result of the first one in a variable, and use that going forward
1 parent f1f82db commit 41c8453

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

op.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8032,11 +8032,13 @@ Perl_pmruntime(pTHX_ OP *o, OP *expr, OP *repl, UV flags, I32 floor)
80328032
konst = TRUE;
80338033
}
80348034
else konst = FALSE;
8035-
if (konst
8036-
&& !(repl_has_vars
8037-
&& (!PM_GETRE(pm)
8038-
|| !RX_PRELEN(PM_GETRE(pm))
8039-
|| RX_EXTFLAGS(PM_GETRE(pm)) & RXf_EVAL_SEEN)))
8035+
8036+
REGEXP * re;
8037+
if ( konst
8038+
&& ! ( repl_has_vars
8039+
&& ( ! (re = PM_GETRE(pm))
8040+
|| ! RX_PRELEN(re)
8041+
|| (RX_EXTFLAGS(re) & RXf_EVAL_SEEN))))
80408042
{
80418043
pm->op_pmflags |= PMf_CONST; /* const for long enough */
80428044
op_prepend_elem(o->op_type, scalar(repl), o);

0 commit comments

Comments
 (0)