Alternative to Array#index?

is there an alternative to Array#index? Faster version maybe?

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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs