This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Clarify the hekp assignment in dump.c
authorFather Chrysostomos <sprout@cpan.org>
Tue, 23 Nov 2010 00:22:08 +0000 (16:22 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 23 Nov 2010 00:22:08 +0000 (16:22 -0800)
dump.c

diff --git a/dump.c b/dump.c
index 26a95d0..f13b9a2 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -1867,6 +1867,13 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
                    SV * const names = sv_newmortal();
                    HEK ** const namep = (HEK **)HvAUX(sv)->xhv_name;
                    const I32 count = HvAUX(sv)->xhv_name_count;
                    SV * const names = sv_newmortal();
                    HEK ** const namep = (HEK **)HvAUX(sv)->xhv_name;
                    const I32 count = HvAUX(sv)->xhv_name_count;
+                   /* This line sets hekp to one element before the first
+                      name, so the ++hekp below will put us at the start-
+                      ing point.
+                      That starting point is the first element if count
+                      is positive and the second element if count
+                      is negative.
+                    */
                    HEK **hekp = namep - (count > 0);
                    sv_setpv(names, "");
                    while (++hekp < namep + (count < 0 ? -count : count))
                    HEK **hekp = namep - (count > 0);
                    sv_setpv(names, "");
                    while (++hekp < namep + (count < 0 ? -count : count))