This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Regen Makefile.SH for CPAN-Meta update
[perl5.git] / mro.c
diff --git a/mro.c b/mro.c
index ccf4bf4..5f7b939 100644 (file)
--- a/mro.c
+++ b/mro.c
@@ -17,7 +17,6 @@
 
 /*
 =head1 MRO Functions
-
 These functions are related to the method resolution order of perl classes
 
 =cut
@@ -143,6 +142,7 @@ Perl_mro_meta_init(pTHX_ HV* stash)
     struct mro_meta* newmeta;
 
     PERL_ARGS_ASSERT_MRO_META_INIT;
+    PERL_UNUSED_CONTEXT;
     assert(HvAUX(stash));
     assert(!(HvAUX(stash)->xhv_mro_meta));
     Newxz(newmeta, 1, struct mro_meta);
@@ -307,19 +307,7 @@ S_mro_get_linear_isa_dfs(pTHX_ HV *stash, U32 level)
                        HEK *const key = HeKEY_hek(he);
 
                        HeVAL(he) = &PL_sv_undef;
-                       /* Save copying by making a shared hash key scalar. We
-                          inline this here rather than calling
-                          Perl_newSVpvn_share because we already have the
-                          scalar, and we already have the hash key.  */
-                       assert(SvTYPE(val) == SVt_NULL);
-                       sv_upgrade(val, SVt_PV);
-                       SvPV_set(val, HEK_KEY(share_hek_hek(key)));
-                       SvCUR_set(val, HEK_LEN(key));
-                       SvIsCOW_on(val);
-                       SvPOK_on(val);
-                       if (HEK_UTF8(key))
-                           SvUTF8_on(val);
-
+                       sv_sethek(val, key);
                        av_push(retval, val);
                    }
                }
@@ -492,7 +480,6 @@ by the C<setisa> magic, should not need to invoke directly.
 void
 Perl_mro_isa_changed_in(pTHX_ HV* stash)
 {
-    dVAR;
     HV* isarev;
     AV* linear_mro;
     HE* iter;
@@ -961,7 +948,7 @@ S_mro_gather_and_rename(pTHX_ HV * const stashes, HV * const seen_stashes,
                const char *name = SvPVx_const(*svp, len);
                if(PL_stashcache) {
                     DEBUG_o(Perl_deb(aTHX_ "mro_gather_and_rename clearing PL_stashcache for '%"SVf"'\n",
-                                     *svp));
+                                     SVfARG(*svp)));
                   (void)hv_delete(PL_stashcache, name, name_utf8 ? -(I32)len : (I32)len, G_DISCARD);
                 }
                 ++svp;
@@ -1402,7 +1389,6 @@ XS(XS_mro_method_changed_in);
 void
 Perl_boot_core_mro(pTHX)
 {
-    dVAR;
     static const char file[] = __FILE__;
 
     Perl_mro_register(aTHX_ &dfs_alg);
@@ -1412,7 +1398,6 @@ Perl_boot_core_mro(pTHX)
 
 XS(XS_mro_method_changed_in)
 {
-    dVAR;
     dXSARGS;
     SV* classname;
     HV* class_stash;