Skip to content

Commit 8de2fd0

Browse files
committed
dump.c: Collapse duplicate macro calls
Instead store the result of the first one in a variable, and use that going forward.
1 parent e3c6b29 commit 8de2fd0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

dump.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -990,18 +990,19 @@ S_do_pmop_dump_bar(pTHX_ I32 level, UV bar, PerlIO *file, const PMOP *pm,
990990
S_opdump_indent(aTHX_ (OP*)pm, level, bar, file,
991991
"PMOFFSET = %" IVdf "\n", (IV)pm->op_pmoffset);
992992
#endif
993+
REGEXP * re = PM_GETRE(pm);
993994
S_opdump_indent(aTHX_ (OP*)pm, level, bar, file,
994-
"REGEX = 0x%" UVxf "\n", PTR2UV(PM_GETRE(pm)));
995+
"REGEX = 0x%" UVxf "\n", PTR2UV(re));
995996

996-
if (PM_GETRE(pm)) {
997+
if (re) {
997998
char ch = (pm->op_pmflags & PMf_ONCE) ? '?' : '/';
998999
S_opdump_indent(aTHX_ (OP*)pm, level, bar, file, "PMf_PRE %c%.*s%c\n",
999-
ch,(int)RX_PRELEN(PM_GETRE(pm)), RX_PRECOMP(PM_GETRE(pm)), ch);
1000+
ch,(int)RX_PRELEN(re), RX_PRECOMP(re), ch);
10001001
}
10011002
else
10021003
S_opdump_indent(aTHX_ (OP*)pm, level, bar, file, "PMf_PRE (RUNTIME)\n");
10031004

1004-
if (pm->op_pmflags || PM_GETRE(pm)) {
1005+
if (pm->op_pmflags || re) {
10051006
SV * const tmpsv = pm_description(pm);
10061007
S_opdump_indent(aTHX_ (OP*)pm, level, bar, file, "PMFLAGS = (%s)\n",
10071008
SvCUR(tmpsv) ? SvPVX_const(tmpsv) + 1 : "");

0 commit comments

Comments
 (0)