This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Document SvOOK_off
[perl5.git] / mro_core.c
index d1abc28..1fc7c7c 100644 (file)
@@ -21,6 +21,7 @@
 /*
 =head1 MRO Functions
 These functions are related to the method resolution order of perl classes
+Also see L<perlmroapi>.
 
 =cut
 */
@@ -118,7 +119,8 @@ Perl_mro_get_from_name(pTHX_ SV *name) {
 
 /*
 =for apidoc mro_register
-Registers a custom mro plugin.  See L<perlmroapi> for details.
+Registers a custom mro plugin.  See L<perlmroapi> for details on this and other
+mro functions.
 
 =cut
 */
@@ -790,7 +792,7 @@ Perl_mro_package_moved(pTHX_ HV * const stash, HV * const oldstash,
        if (name_count < 0) ++namep, name_count = -name_count - 1;
     }
     if (name_count == 1) {
-       if (HEK_LEN(*namep) == 4 && strnEQ(HEK_KEY(*namep), "main", 4)) {
+       if (memEQs(HEK_KEY(*namep), HEK_LEN(*namep), "main")) {
            namesv = GvNAMELEN(gv) == 1
                ? newSVpvs_flags(":", SVs_TEMP)
                : newSVpvs_flags("",  SVs_TEMP);
@@ -812,7 +814,7 @@ Perl_mro_package_moved(pTHX_ HV * const stash, HV * const oldstash,
        SV *aname;
        namesv = sv_2mortal((SV *)newAV());
        while (name_count--) {
-           if(HEK_LEN(*namep) == 4 && strnEQ(HEK_KEY(*namep), "main", 4)){
+           if(memEQs(HEK_KEY(*namep), HEK_LEN(*namep), "main")){
                aname = GvNAMELEN(gv) == 1
                         ? newSVpvs(":")
                         : newSVpvs("");
@@ -857,15 +859,15 @@ Perl_mro_package_moved(pTHX_ HV * const stash, HV * const oldstash,
        mro_isa_changed_in on each. */
     hv_iterinit(stashes);
     while((iter = hv_iternext(stashes))) {
-       HV * const stash = *(HV **)HEK_KEY(HeKEY_hek(iter));
-       if(HvENAME(stash)) {
+       HV * const this_stash = *(HV **)HEK_KEY(HeKEY_hek(iter));
+       if(HvENAME(this_stash)) {
            /* We have to restore the original meta->isa (that
               mro_gather_and_rename set aside for us) this way, in case
               one class in this list is a superclass of a another class
               that we have already encountered. In such a case, meta->isa
-
+              will have been overwritten without old entries being deleted
               from PL_isarev. */
-           struct mro_meta * const meta = HvMROMETA(stash);
+           struct mro_meta * const meta = HvMROMETA(this_stash);
            if(meta->isa != (HV *)HeVAL(iter)){
                SvREFCNT_dec(meta->isa);
                meta->isa
@@ -874,7 +876,7 @@ Perl_mro_package_moved(pTHX_ HV * const stash, HV * const oldstash,
                    : (HV *)HeVAL(iter);
                HeVAL(iter) = NULL; /* We donated our reference count. */
            }
-           mro_isa_changed_in(stash);
+           mro_isa_changed_in(this_stash);
        }
     }
 }