From: SynaptiCAD, Inc. Date: Sat, 2 May 1998 16:29:22 +0000 (-0400) Subject: [win32] make hv_iterinit() return HvKEYS() X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c6601927a584c0fd18d5a6bb3b4c95cff46a2c6a;p=p5sagit%2Fp5-mst-13.2.git [win32] make hv_iterinit() return HvKEYS() Message-Id: <3.0.1.32.19980502162922.009e6320@www.syncad.com> Subject: incorrect return value for hv_iterinit p4raw-id: //depot/win32/perl@914 --- diff --git a/hv.c b/hv.c index cb7fbfb..5756b4b 100644 --- a/hv.c +++ b/hv.c @@ -966,7 +966,7 @@ hv_iterinit(HV *hv) } xhv->xhv_riter = -1; xhv->xhv_eiter = Null(HE*); - return xhv->xhv_fill; /* should be xhv->xhv_keys? May change later */ + return xhv->xhv_keys; /* used to be xhv->xhv_fill before 5.004_65 */ } HE * diff --git a/pod/perlguts.pod b/pod/perlguts.pod index 9b7cab6..83986c9 100644 --- a/pod/perlguts.pod +++ b/pod/perlguts.pod @@ -1888,10 +1888,13 @@ Prepares a starting point to traverse a hash table. I32 hv_iterinit (HV* tb) -Note that hv_iterinit I returns the number of I in -the hash and I the number of keys (as indicated in the Advanced -Perl Programming book). This may change in future. Use the HvKEYS(hv) -macro to find the number of keys in a hash. +Returns the number of keys in the hash (i.e. the same as C). +The return value is currently only meaningful for hashes without tie +magic. + +NOTE: Before version 5.004_65, C used to return the number +of hash buckets that happen to be in use. If you still need that +esoteric value, you can get it through the macro C. =item hv_iterkey