mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 12:34:21 +00:00
This is more concise and ruby does a better job performance-wise.
This used to be `bsearch_index` already but 6d8358c083 changed it.
https://github.com/ruby/prism/pull/1733#discussion_r1373702087 said:
> Yeah the edge case was that the value matched an element exactly
But surely there would be a test to show this behaviour?
Gets called as part of pretty-printing nodes.
Further reduces the time for `SnapshotsTest` by ~16% for me.
https://github.com/ruby/prism/commit/f448e2b995