This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
gv.c: Remove mro_method_changed_in() from gv_init
authorFather Chrysostomos <sprout@cpan.org>
Sun, 10 Jun 2012 23:21:59 +0000 (16:21 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 15 Jun 2012 19:28:14 +0000 (12:28 -0700)
gv_init(_pvn) does not conceptually change anything.  There was
already a subroutine there before the stub was upgraded to a gv with
a real cv.

The example in the comment:

 sub Foo::bar($) { (shift) } sub ASDF::baz($); *ASDF::baz = \&Foo::bar

suggests that this was put in the wrong place to begin with.  Glob
assignment already takes care of mro_method_changed_in, so calling
it beforehand when reifying the glob is redundant.

gv.c

diff --git a/gv.c b/gv.c
index 469d46a..8bf975e 100644 (file)
--- a/gv.c
+++ b/gv.c
@@ -390,7 +390,6 @@ Perl_gv_init_pvn(pTHX_ GV *gv, HV *stash, const char *name, STRLEN len, U32 flag
            LEAVE;
        }
 
-        mro_method_changed_in(GvSTASH(gv)); /* sub Foo::bar($) { (shift) } sub ASDF::baz($); *ASDF::baz = \&Foo::bar */
        CvGV_set(cv, gv);
        CvFILE_set_from_cop(cv, PL_curcop);
        CvSTASH_set(cv, PL_curstash);