Forum: Ruby alternative to Array#index?

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.
Aaron S. (Guest)
on 2007-06-26 03:06
is there an alternative to Array#index? Faster version maybe?
Alex Y. (Guest)
on 2007-06-26 11:17
(Received via mailing list)
Aaron S. wrote:
> is there an alternative to Array#index? Faster version maybe?
>
Change the problem so that you're reading from a hash?  Maintain an
index hash alongside the array?  Keep the array sorted somehow?  It
depends on the problem you're trying to solve, really...
This topic is locked and can not be replied to.