in reply to Re^3: When does Perl double the number of buckets in hash?
in thread When does Perl double the number of buckets in hash?
This seems to suggest that doubling occurs only when the number of keys (including the new one) is more than the number of buckets.
MAX is the highest bucket index (0-based), not the number of buckets. From illguts,
KEYS is the number of hash elements in the HASH.
MAX is the number of elements in ARRAY minus one.
So KEYS >= MAX+1 and KEYS > MAX are true if the number of keys is equal to the number of buckets.
|
|---|