[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

hash.each and hash.each_pair

Hunt Jon

12/18/2008 2:04:00 PM

I looked at RDoc documentation.

It says "each_pair" method is marginally more efficient.

Do we need to abandon "each"? Do you use "each" or stick to "each_pair"?

2 Answers

Robert Klemme

12/18/2008 2:57:00 PM

0

2008/12/18 Hunt Jon <jona.hunt777@gmail.com>:
> I looked at RDoc documentation.
>
> It says "each_pair" method is marginally more efficient.
>
> Do we need to abandon "each"? Do you use "each" or stick to "each_pair"?

I do not care.

Kind regards

robert

--
remember.guy do |as, often| as.you_can - without end

Simon Krahnke

12/20/2008 3:07:00 PM

0

* Hunt Jon <jona.hunt777@gmail.com> (2008-12-18) schrieb:

> I looked at RDoc documentation.
>
> It says "each_pair" method is marginally more efficient.
>
> Do we need to abandon "each"? Do you use "each" or stick to "each_pair"?

»each_pair« is the better name for what it's doing and »each« is a standard
name used by »for« and »Enumeration«.

mfg, simon .... l