summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-10-27 06:35:35 -0700
committerFather Chrysostomos <sprout@cpan.org>2013-10-28 16:15:09 -0700
commit0ca9877d08d37b8bc87c72cc832142c90f929378 (patch)
tree6679beb57c25035ffb0fcb4d4730fba146d85a16 /gv.c
parent4639d557ab77c475c9938688efe6b61bedcecf8b (diff)
downloadperl-0ca9877d08d37b8bc87c72cc832142c90f929378.tar.gz
When deleting via hek, pass the computed hash value
In those cases where the hash key comes from a hek, we already have a computed hash value, so pass that to hv_common. The easiest way to accomplish this is to add a new macro.
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/gv.c b/gv.c
index 4e0611b66b..70e638efba 100644
--- a/gv.c
+++ b/gv.c
@@ -2379,9 +2379,7 @@ Perl_gp_free(pTHX_ GV *gv)
const HEK *hvname_hek = HvNAME_HEK(hv);
DEBUG_o(Perl_deb(aTHX_ "gp_free clearing PL_stashcache for '%"HEKf"'\n", hvname_hek));
if (PL_stashcache && hvname_hek)
- (void)hv_delete(PL_stashcache, HEK_KEY(hvname_hek),
- (HEK_UTF8(hvname_hek) ? -HEK_LEN(hvname_hek) : HEK_LEN(hvname_hek)),
- G_DISCARD);
+ (void)hv_deletehek(PL_stashcache, hvname_hek, G_DISCARD);
SvREFCNT_dec(hv);
}
SvREFCNT_dec(io);
@@ -3336,8 +3334,7 @@ Perl_gv_try_downgrade(pTHX_ GV *gv)
cv = GvCV(gv);
if (!cv) {
HEK *gvnhek = GvNAME_HEK(gv);
- (void)hv_delete(stash, HEK_KEY(gvnhek),
- HEK_UTF8(gvnhek) ? -HEK_LEN(gvnhek) : HEK_LEN(gvnhek), G_DISCARD);
+ (void)hv_deletehek(stash, gvnhek, G_DISCARD);
} else if (GvMULTI(gv) && cv &&
!SvOBJECT(cv) && !SvMAGICAL(cv) && !SvREADONLY(cv) &&
CvSTASH(cv) == stash && CvGV(cv) == gv &&