Right, but I thought that using each didn't create a new list. But slapping a quick Benchmark together I see that keys is nearly 3x faster than each, and values is more than twice as fast as keys ... that totally blows my understanding of the process. And here I've been favoring each over keys or values on the grounds that it used less memory and was faster ... man have I been wrong!
In reply to Re: Re^2: Counting keys with defined or undefined elements in a hash (behaviour of values())
by Oberon
in thread Counting keys with defined or undefined elements in a hash
by Bukowski
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |