summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-06-10 11:17:40 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-06-15 12:28:14 -0700
commit9a62b98f29d24f2f699a5e6d46641ac9fe8f9652 (patch)
treedf187d98a4990dcd8573abaad37e1fd0626d6199 /gv.c
parent0c41dfff8aeb7c12a62a1bcd03e3e742c3f7c344 (diff)
downloadperl-9a62b98f29d24f2f699a5e6d46641ac9fe8f9652.tar.gz
gv.c: Don’t ENTER/LEAVE unnecessarily
Commit 756cb47730 added an if/else block in between ENTER/LEAVE, mov- ing the existing code into the else block. But the if code (consist- ing of newCONSTSUB) never needed to be surrounded by ENTER/LEAVE.
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gv.c b/gv.c
index 020e2a219c..469d46a6d6 100644
--- a/gv.c
+++ b/gv.c
@@ -370,7 +370,6 @@ Perl_gv_init_pvn(pTHX_ GV *gv, HV *stash, const char *name, STRLEN len, U32 flag
GvMULTI_on(gv); /* _was_ mentioned */
if (doproto) { /* Replicate part of newSUB here. */
CV *cv;
- ENTER;
if (has_constant) {
/* newCONSTSUB takes ownership of the reference from us. */
cv = newCONSTSUB_flags(stash, name, len, flags, has_constant);
@@ -384,11 +383,12 @@ Perl_gv_init_pvn(pTHX_ GV *gv, HV *stash, const char *name, STRLEN len, U32 flag
if (exported_constant)
GvIMPORTED_CV_on(gv);
} else {
+ ENTER;
(void) start_subparse(0,0); /* Create empty CV in compcv. */
cv = PL_compcv;
GvCV_set(gv,cv);
+ LEAVE;
}
- LEAVE;
mro_method_changed_in(GvSTASH(gv)); /* sub Foo::bar($) { (shift) } sub ASDF::baz($); *ASDF::baz = \&Foo::bar */
CvGV_set(cv, gv);