-
Notifications
You must be signed in to change notification settings - Fork 377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reverse.detect vs select { ... }.last #98
Comments
This test is biased in favor of reverse each because it bails on the first element, 100. A fairer test would be to search for (x % 51).zero?, since we expect to traverse about half the elements on average. |
Results with
|
Wow. That sure seems to level the playing field. |
I'd propose replacing If there's support behind this, I'm happy to whip up a PR for it! |
Yes, It's worth an update! |
Third approach?
The text was updated successfully, but these errors were encountered: