Skip to content

Commit

Permalink
In Perl_gv_check() set and clear HvAUXf_SCAN_STASH just once.
Browse files Browse the repository at this point in the history
Previously the flag bit was set and cleared for each iteration of the outer
loop. The compiler *might* have made this optimisation that this commit makes
for us, but might not.
  • Loading branch information
nwc10 committed Jul 26, 2021
1 parent bd4f91e commit 0cdaae3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gv.c
Expand Up @@ -2652,10 +2652,10 @@ Perl_gv_check(pTHX_ HV *stash)

assert(HvARRAY(stash));

/* mark stash is being scanned, to avoid recursing */
HvAUX(stash)->xhv_aux_flags |= HvAUXf_SCAN_STASH;
for (i = 0; i <= (I32) HvMAX(stash); i++) {
const HE *entry;
/* mark stash is being scanned, to avoid recursing */
HvAUX(stash)->xhv_aux_flags |= HvAUXf_SCAN_STASH;
for (entry = HvARRAY(stash)[i]; entry; entry = HeNEXT(entry)) {
GV *gv;
HV *hv;
Expand Down Expand Up @@ -2696,8 +2696,8 @@ Perl_gv_check(pTHX_ HV *stash)
HEKfARG(GvNAME_HEK(gv)));
}
}
HvAUX(stash)->xhv_aux_flags &= ~HvAUXf_SCAN_STASH;
}
HvAUX(stash)->xhv_aux_flags &= ~HvAUXf_SCAN_STASH;
}

GV *
Expand Down

0 comments on commit 0cdaae3

Please sign in to comment.