From: Tassilo von Parseval Date: Mon, 8 Dec 2003 08:17:46 +0000 (+0100) Subject: iterator reset moved to hv.c (was: [PATCH] SCALAR/FIRSTKEY for tied hashes in scalar... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=df8c69647dfe89de227fd81e7ece25070f8b880e;p=p5sagit%2Fp5-mst-13.2.git iterator reset moved to hv.c (was: [PATCH] SCALAR/FIRSTKEY for tied hashes in scalar context) Message-id: <20031208071746.GA594@ethan> p4raw-id: //depot/perl@21869 --- diff --git a/hv.c b/hv.c index ec616c0..4f95d1e 100644 --- a/hv.c +++ b/hv.c @@ -1452,7 +1452,7 @@ Perl_hv_clear(pTHX_ HV *hv) } } } - return; + goto reset; } hfreeentries(hv); @@ -1466,6 +1466,8 @@ Perl_hv_clear(pTHX_ HV *hv) HvHASKFLAGS_off(hv); HvREHASH_off(hv); + reset: + HvEITER(hv) = NULL; } /* diff --git a/mg.c b/mg.c index 2529ff7..7955e52 100644 --- a/mg.c +++ b/mg.c @@ -1539,11 +1539,6 @@ Perl_magic_wipepack(pTHX_ SV *sv, MAGIC *mg) POPSTACK; LEAVE; - if (SvTYPE(sv) == SVt_PVHV) - /* must reset iterator otherwise Perl_magic_scalarpack - * wont report a false value on a cleared hash */ - HvEITER((HV*)sv) = NULL; - return 0; }