diff options
author | David Mitchell <davem@iabyn.com> | 2011-05-03 16:07:51 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2011-05-19 14:49:43 +0100 |
commit | 5f243b5ff09626b3b2ed4569515c4a27a2a18137 (patch) | |
tree | 28867c60838fa58fbc688442f41807c677ca1d86 /hv.c | |
parent | d5683f9a2482a20fa3a244bc371a0f172d409e5b (diff) | |
download | perl-5f243b5ff09626b3b2ed4569515c4a27a2a18137.tar.gz |
hfreeentries zeros HvARRAY now, so skip manual
Formerly, hv_clear() and hv_undef() zeroed the contents of
HvARRAY after calling hfreeentries(), but that sub now zeroes
each elements as a by-product of its deleting algorithm.
So we can skip the Zero().
Diffstat (limited to 'hv.c')
-rw-r--r-- | hv.c | 13 |
1 files changed, 1 insertions, 12 deletions
@@ -1544,8 +1544,6 @@ Perl_hv_clear(pTHX_ HV *hv) else { hfreeentries(hv); HvPLACEHOLDERS_set(hv, 0); - if (HvARRAY(hv)) - Zero(HvARRAY(hv), xhv->xhv_max+1 /* HvMAX(hv)+1 */, HE*); if (SvRMAGICAL(hv)) mg_clear(MUTABLE_SV(hv)); @@ -1745,17 +1743,10 @@ Perl_hv_undef_flags(pTHX_ HV *hv, U32 flags) if (SvOOK(hv)) { struct xpvhv_aux * const aux = HvAUX(hv); struct mro_meta *meta; - bool zeroed = FALSE; if ((name = HvENAME_get(hv))) { - if (PL_phase != PERL_PHASE_DESTRUCT) { - /* This must come at this point in case - mro_isa_changed_in dies. */ - Zero(HvARRAY(hv), xhv->xhv_max+1 /* HvMAX(hv)+1 */, HE*); - zeroed = TRUE; - + if (PL_phase != PERL_PHASE_DESTRUCT) mro_isa_changed_in(hv); - } if (PL_stashcache) (void)hv_delete( PL_stashcache, name, HvENAMELEN_get(hv), G_DISCARD @@ -1789,8 +1780,6 @@ Perl_hv_undef_flags(pTHX_ HV *hv, U32 flags) } if (!aux->xhv_name_u.xhvnameu_name && ! aux->xhv_backreferences) SvFLAGS(hv) &= ~SVf_OOK; - else if (!zeroed) - Zero(HvARRAY(hv), xhv->xhv_max+1 /* HvMAX(hv)+1 */, HE*); } if (!SvOOK(hv)) { Safefree(HvARRAY(hv)); |