From: Abhijit Menon-Sen Date: Wed, 10 Oct 2001 21:59:33 +0000 (+0530) Subject: Re: /usr/include/sys/e ?? (perl@12340) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ecfc864712c3adc100dc5f6f36fc5dfc21c6f29b;p=p5sagit%2Fp5-mst-13.2.git Re: /usr/include/sys/e ?? (perl@12340) Message-Id: <20011010215933.B2444@lustre.dyn.wiw.org> p4raw-id: //depot/perl@12394 --- diff --git a/ext/Data/Dumper/Dumper.xs b/ext/Data/Dumper/Dumper.xs index d0eb917..1b6aeca 100644 --- a/ext/Data/Dumper/Dumper.xs +++ b/ext/Data/Dumper/Dumper.xs @@ -531,15 +531,19 @@ DD_dump(pTHX_ SV *val, char *name, STRLEN namelen, SV *retval, HV *seenhv, } else (void)hv_iterinit((HV*)ival); - i = 0; - while (sortkeys ? (void*)(keys && (i <= av_len(keys))) : - (void*)((entry = hv_iternext((HV*)ival))) ) { + + /* foreach (keys %hash) */ + for (i = 0; 1; i++) { char *nkey = NULL; I32 nticks = 0; SV* keysv; STRLEN keylen; bool do_utf8 = FALSE; - + + if ((sortkeys && !(keys && i <= av_len(keys))) || + !(entry = hv_iternext((HV *)ival))) + break; + if (i) sv_catpvn(retval, ",", 1); @@ -556,8 +560,6 @@ DD_dump(pTHX_ SV *val, char *name, STRLEN namelen, SV *retval, HV *seenhv, hval = hv_iterval((HV*)ival, entry); } - i++; - do_utf8 = DO_UTF8(keysv); key = SvPV(keysv, keylen); klen = keylen;