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.
9239e324751b8db551789e5e16689438?d=identicon&s=25 Hunt Jon (Guest)
on 2008-12-18 15: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"?
E0d864d9677f3c1482a20152b7cac0e2?d=identicon&s=25 Robert Klemme (Guest)
on 2008-12-18 16:06
(Received via mailing list)
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
1d53b088a989e069b94597c282eebbbc?d=identicon&s=25 Simon Krahnke (Guest)
on 2008-12-20 16:36
(Received via mailing list)
* 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
This topic is locked and can not be replied to.