summaryrefslogtreecommitdiff
path: root/dump.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-06-11 12:22:52 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-06-11 13:19:29 -0700
commitcbab3169ecbf1e0e61d0f4d55bd0034da1331d90 (patch)
tree38b8daee3d3734397591c7cb0c75ab9784b12311 /dump.c
parente56c1e8df64af1aeccf399e2ac6fb3ac25abbc55 (diff)
downloadperl-cbab3169ecbf1e0e61d0f4d55bd0034da1331d90.tar.gz
Revert "Perl_do_sv_dump: alert when skipping elements"
This reverts commit 002beaef76a1595af2e39ffd4cd55c595bd6c271. I am about to apply the manual-iteration patch from ticket #85026. It conflicts with 002beaef, but it also renders 002beaef unnecessary.
Diffstat (limited to 'dump.c')
-rw-r--r--dump.c49
1 files changed, 22 insertions, 27 deletions
diff --git a/dump.c b/dump.c
index f9556c3c9b..a5d71bc98d 100644
--- a/dump.c
+++ b/dump.c
@@ -1918,34 +1918,29 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
}
}
}
- if (nest < maxnest) {
- if (HvEITER_get(sv)) /* preserve iterator */
- Perl_dump_indent(aTHX_ level, file,
- " (*** Active iterator; skipping element dump ***)\n");
- else {
- HE *he;
- HV * const hv = MUTABLE_HV(sv);
- int count = maxnest - nest;
-
- hv_iterinit(hv);
- while ((he = hv_iternext_flags(hv, HV_ITERNEXT_WANTPLACEHOLDERS))
- && count--) {
- STRLEN len;
- const U32 hash = HeHASH(he);
- SV * const keysv = hv_iterkeysv(he);
- const char * const keypv = SvPV_const(keysv, len);
- SV * const elt = hv_iterval(hv, he);
-
- Perl_dump_indent(aTHX_ level+1, file, "Elt %s ", pv_display(d, keypv, len, 0, pvlim));
- if (SvUTF8(keysv))
- PerlIO_printf(file, "[UTF8 \"%s\"] ", sv_uni_display(d, keysv, 6 * SvCUR(keysv), UNI_DISPLAY_QQ));
- if (HeKREHASH(he))
- PerlIO_printf(file, "[REHASH] ");
- PerlIO_printf(file, "HASH = 0x%"UVxf"\n", (UV)hash);
- do_sv_dump(level+1, file, elt, nest+1, maxnest, dumpops, pvlim);
- }
- hv_iterinit(hv); /* Return to status quo */
+ if (nest < maxnest && !HvEITER_get(sv)) { /* Try to preserve iterator */
+ HE *he;
+ HV * const hv = MUTABLE_HV(sv);
+ int count = maxnest - nest;
+
+ hv_iterinit(hv);
+ while ((he = hv_iternext_flags(hv, HV_ITERNEXT_WANTPLACEHOLDERS))
+ && count--) {
+ STRLEN len;
+ const U32 hash = HeHASH(he);
+ SV * const keysv = hv_iterkeysv(he);
+ const char * const keypv = SvPV_const(keysv, len);
+ SV * const elt = hv_iterval(hv, he);
+
+ Perl_dump_indent(aTHX_ level+1, file, "Elt %s ", pv_display(d, keypv, len, 0, pvlim));
+ if (SvUTF8(keysv))
+ PerlIO_printf(file, "[UTF8 \"%s\"] ", sv_uni_display(d, keysv, 6 * SvCUR(keysv), UNI_DISPLAY_QQ));
+ if (HeKREHASH(he))
+ PerlIO_printf(file, "[REHASH] ");
+ PerlIO_printf(file, "HASH = 0x%"UVxf"\n", (UV)hash);
+ do_sv_dump(level+1, file, elt, nest+1, maxnest, dumpops, pvlim);
}
+ hv_iterinit(hv); /* Return to status quo */
}
break;