Forum: Ruby hash.each and hash.each_pair

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Hunt J. (Guest)
on 2008-12-18 16:12
(Received via mailing list)
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"?
Robert K. (Guest)
on 2008-12-18 17:06
(Received via mailing list)
2008/12/18 Hunt J. <removed_email_address@domain.invalid>:
> 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
Simon K. (Guest)
on 2008-12-20 17:36
(Received via mailing list)
* Hunt J. <removed_email_address@domain.invalid> (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
This topic is locked and can not be replied to.