This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Perl_hv_fill() can return early if the hash only has 0 or 1 keys.
authorNicholas Clark <nick@ccl4.org>
Mon, 11 Mar 2013 11:18:11 +0000 (11:18 +0000)
committerNicholas Clark <nick@ccl4.org>
Mon, 27 May 2013 08:36:27 +0000 (10:36 +0200)
commit553215cca7b3b92e1c96ef45917ee18dc7446644
tree2143d9f7d8220a20f0c6e55ed99fbcf1f7972412
parent2fff5797d3953494057797f7669b69425e76edcc
Perl_hv_fill() can return early if the hash only has 0 or 1 keys.

No keys implies no chains used, so the return value is 0. One key
unambiguously means 1 chain used, and all the others are free. Two or more
keys might share the same chain, or might not, so the calculation can't be
short-circuited.
hv.c