summaryrefslogtreecommitdiff
path: root/dump.c
diff options
context:
space:
mode:
authorMichael Witten <mfwitten@gmail.com>2011-03-14 06:57:43 +0000
committerFather Chrysostomos <sprout@cpan.org>2011-05-18 16:35:16 -0700
commit1b95d04f713d9c56e4957326f9f6b0481216a00c (patch)
tree9f57b4048cfba9c60f2f933d4e9305cc149dfa80 /dump.c
parentb9f41ca854adae9c928d96cb3c1612b18866516e (diff)
downloadperl-1b95d04f713d9c56e4957326f9f6b0481216a00c.tar.gz
Clean: Actually use HvUSEDKEYS() instead of HvKEYS()
This: commit 8aacddc1ea3837f8f1a911d90c644451fc7cfc86 Author: Nick Ing-Simmons <nik@tiuk.ti.com> Date: Tue Dec 18 15:55:22 2001 +0000 Tidied version of Jeffrey Friedl's <jfriedl@yahoo.com> restricted hashes - added delete of READONLY value inhibit & test for same - re-tabbed p4raw-id: //depot/perlio@13760 essentially deprecated HvKEYS() in favor of HvUSEDKEYS(); this is explained in line 144 (now 313) of file `hv.h': /* * HvKEYS gets the number of keys that actually exist(), and is provided * for backwards compatibility with old XS code. The core uses HvUSEDKEYS * (keys, excluding placeholdes) and HvTOTALKEYS (including placeholders) */ This commit simply puts that into practice, and is equivalent to running the following (at least with a35ef416833511da752c4b5b836b7a8915712aab checked out): git grep -l HvKEYS | sed /hv.h/d | xargs sed -i s/HvKEYS/HvUSEDKEYS/ Notice that HvKEYS is currently just an alias for HvUSEDKEYS: $ git show a35ef416833511da752c4b5b836b7a8915712aab:hv.h | sed -n 318p #define HvKEYS(hv) HvUSEDKEYS(hv) According to `make tests': All tests successful.
Diffstat (limited to 'dump.c')
-rw-r--r--dump.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/dump.c b/dump.c
index 4e98394848..32e7596c63 100644
--- a/dump.c
+++ b/dump.c
@@ -1830,13 +1830,13 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
break;
case SVt_PVHV:
Perl_dump_indent(aTHX_ level, file, " ARRAY = 0x%"UVxf, PTR2UV(HvARRAY(sv)));
- if (HvARRAY(sv) && HvKEYS(sv)) {
+ if (HvARRAY(sv) && HvUSEDKEYS(sv)) {
/* Show distribution of HEs in the ARRAY */
int freq[200];
#define FREQ_MAX ((int)(sizeof freq / sizeof freq[0] - 1))
int i;
int max = 0;
- U32 pow2 = 2, keys = HvKEYS(sv);
+ U32 pow2 = 2, keys = HvUSEDKEYS(sv);
NV theoret, sum = 0;
PerlIO_printf(file, " (");
@@ -1878,13 +1878,13 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
}
while ((keys = keys >> 1))
pow2 = pow2 << 1;
- theoret = HvKEYS(sv);
+ theoret = HvUSEDKEYS(sv);
theoret += theoret * (theoret-1)/pow2;
PerlIO_putc(file, '\n');
Perl_dump_indent(aTHX_ level, file, " hash quality = %.1"NVff"%%", theoret/sum*100);
}
PerlIO_putc(file, '\n');
- Perl_dump_indent(aTHX_ level, file, " KEYS = %"IVdf"\n", (IV)HvKEYS(sv));
+ Perl_dump_indent(aTHX_ level, file, " KEYS = %"IVdf"\n", (IV)HvUSEDKEYS(sv));
Perl_dump_indent(aTHX_ level, file, " FILL = %"IVdf"\n", (IV)HvFILL(sv));
Perl_dump_indent(aTHX_ level, file, " MAX = %"IVdf"\n", (IV)HvMAX(sv));
Perl_dump_indent(aTHX_ level, file, " RITER = %"IVdf"\n", (IV)HvRITER_get(sv));