summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2010-09-01 10:56:47 +0100
committerNicholas Clark <nick@ccl4.org>2010-09-01 10:56:47 +0100
commit7b1903740d907382fa6f406bd7ab1262921746c8 (patch)
treeecf3b2209495133e8daa99369b56715b436ea931 /pp_sys.c
parenta77ac40c5b8111e15c16279ce494e3aafde2b18e (diff)
downloadperl-7b1903740d907382fa6f406bd7ab1262921746c8.tar.gz
Move the call to Perl_cv_clone() into S_doform(), from its two callers.
This reduces code duplication slightly, and reduces the object code size.
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 74c0be2922..1bc072d490 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -1275,6 +1275,9 @@ S_doform(pTHX_ CV *cv, GV *gv, OP *retop)
PERL_ARGS_ASSERT_DOFORM;
+ if (cv && CvCLONE(cv))
+ cv = MUTABLE_CV(sv_2mortal(MUTABLE_SV(cv_clone(cv))));
+
ENTER;
SAVETMPS;
@@ -1330,9 +1333,6 @@ PP(pp_enterwrite)
not_a_format_reference:
DIE(aTHX_ "Not a format reference");
}
- if (CvCLONE(cv))
- cv = MUTABLE_CV(sv_2mortal(MUTABLE_SV(cv_clone(cv))));
-
IoFLAGS(io) &= ~IOf_DIDTOP;
return doform(cv,gv,PL_op->op_next);
}
@@ -1421,8 +1421,6 @@ PP(pp_leavewrite)
else
DIE(aTHX_ "Undefined top format called");
}
- if (cv && CvCLONE(cv))
- cv = MUTABLE_CV(sv_2mortal(MUTABLE_SV(cv_clone(cv))));
return doform(cv, gv, PL_op);
}