Skip to content

Commit 17fb8b3

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 8de2fd0 commit 17fb8b3

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
@@ -8035,11 +8035,13 @@ Perl_pmruntime(pTHX_ OP *o, OP *expr, OP *repl, UV flags, I32 floor)
80358035
konst = TRUE;
80368036
}
80378037
else konst = FALSE;
8038-
if (konst
8039-
&& !(repl_has_vars
8040-
&& (!PM_GETRE(pm)
8041-
|| !RX_PRELEN(PM_GETRE(pm))
8042-
|| RX_EXTFLAGS(PM_GETRE(pm)) & RXf_EVAL_SEEN)))
8038+
8039+
REGEXP * re;
8040+
if ( konst
8041+
&& ! ( repl_has_vars
8042+
&& ( ! (re = PM_GETRE(pm))
8043+
|| ! RX_PRELEN(re)
8044+
|| (RX_EXTFLAGS(re) & RXf_EVAL_SEEN))))
80438045
{
80448046
pm->op_pmflags |= PMf_CONST; /* const for long enough */
80458047
op_prepend_elem(o->op_type, scalar(repl), o);

0 commit comments

Comments
 (0)