diff options
author | David Mitchell <davem@iabyn.com> | 2011-04-26 16:07:50 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2011-05-19 14:49:42 +0100 |
commit | afbbf215a9f8470ac637c1eddc1d4f0eaa8ab090 (patch) | |
tree | 58f9dfc15d0bb82c174c60aba2928bec354dc8e3 /hv.c | |
parent | f126b75f4148fff81c891eb4f3eb7a4e6fca9ee3 (diff) | |
download | perl-afbbf215a9f8470ac637c1eddc1d4f0eaa8ab090.tar.gz |
simplify hv_clear
Don't use a goto when an else will do
i.e. replace
if (..) {
A
goto reset
}
B
reset:
with
if (..) {
A
}
else {
B
}
Diffstat (limited to 'hv.c')
-rw-r--r-- | hv.c | 21 |
1 files changed, 10 insertions, 11 deletions
@@ -1548,20 +1548,19 @@ Perl_hv_clear(pTHX_ HV *hv) } } } - goto reset; } + else { + hfreeentries(hv); + HvPLACEHOLDERS_set(hv, 0); + if (HvARRAY(hv)) + Zero(HvARRAY(hv), xhv->xhv_max+1 /* HvMAX(hv)+1 */, HE*); - 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)); + if (SvRMAGICAL(hv)) + mg_clear(MUTABLE_SV(hv)); - HvHASKFLAGS_off(hv); - HvREHASH_off(hv); - reset: + HvHASKFLAGS_off(hv); + HvREHASH_off(hv); + } if (SvOOK(hv)) { if(HvENAME_get(hv)) mro_isa_changed_in(hv); |