summaryrefslogtreecommitdiff
path: root/hv.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2011-04-26 16:07:50 +0100
committerDavid Mitchell <davem@iabyn.com>2011-05-19 14:49:42 +0100
commitafbbf215a9f8470ac637c1eddc1d4f0eaa8ab090 (patch)
tree58f9dfc15d0bb82c174c60aba2928bec354dc8e3 /hv.c
parentf126b75f4148fff81c891eb4f3eb7a4e6fca9ee3 (diff)
downloadperl-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.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/hv.c b/hv.c
index 390eba8be8..a37ed09d82 100644
--- a/hv.c
+++ b/hv.c
@@ -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);