-
Notifications
You must be signed in to change notification settings - Fork 919
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
Add failure mode to write_list
#251
Conversation
mem_profiler_chan, | ||
devtools_chan, | ||
storage_task, | ||
supports_clipboard); |
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.
nice :-)
looks good! Other than the inline comments, there are a couple of FIXMEs on magic |
_ if tries > 10 => return None, | ||
Ok(result) => return Some(result), | ||
Err(Ordering::Less) => { | ||
lo = middle; |
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.
This may be way off, but should it be lo = middle + 1
to avoid infinite loop in case hi = lo + 1? Same for hi = middle - 1
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.
You're absolutely right! I guess this proves @nrc's point about binary search being prone to off-by-one errors ;-)
Add failure mode to `write_list`
Fixes some cases where we would exceed the column limit.