summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2021-07-21 07:05:47 +0000
committerNicholas Clark <nick@ccl4.org>2021-07-26 07:06:00 +0000
commit0cdaae3e56c7eb2fab73f258cf564fe0d6d1b083 (patch)
treea0bedbe0b9e955c48ed45d9d4584cce889eacca1 /gv.c
parentbd4f91e548cd03e60692e013e23c0fff31ead346 (diff)
downloadperl-0cdaae3e56c7eb2fab73f258cf564fe0d6d1b083.tar.gz
In Perl_gv_check() set and clear HvAUXf_SCAN_STASH just once.
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.
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gv.c b/gv.c
index fcde2123c0..306a5240f8 100644
--- a/gv.c
+++ b/gv.c
@@ -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;
@@ -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 *