-
Notifications
You must be signed in to change notification settings - Fork 385
Use Vec's binary search instead of hand-written one. #3021
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
Conversation
// We are too far right (offset is further left). | ||
debug_assert!(candidate < right); // we are making progress | ||
right = candidate; | ||
std::cmp::Ordering::Greater |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please preserve the comments inside the if
s here, they still seem helpful.
Also have the comment explain that Greater
indicates "elem
is greater than desired target".
Thanks, this looks much cleaner! @bors r+ |
☀️ Test successful - checks-actions |
It's similar to rust-lang#3021 and should improve maintainability.
It's similar to rust-lang#3021 and should improve maintainability.
Replace hand-written binary search with Vec::binary_search_by. It's similar to #3021 and should improve maintainability.
It's similar to rust-lang/miri#3021 and should improve maintainability.
…Jung Replace hand-written binary search with Vec::binary_search_by. It's similar to rust-lang/miri#3021 and should improve maintainability.
…Jung Replace hand-written binary search with Vec::binary_search_by. It's similar to rust-lang/miri#3021 and should improve maintainability.
…Jung Replace hand-written binary search with Vec::binary_search_by. It's similar to rust-lang/miri#3021 and should improve maintainability.
No description provided.