-
Notifications
You must be signed in to change notification settings - Fork 13.3k
RingBuf split_off and append impls #22058
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
r? @huonw |
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
Found an error, retesting |
All fixed. |
let first_len = first_half.len(); | ||
let second_len = second_half.len(); | ||
if at < first_len { | ||
// `at` lies in the first half. |
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 explicitly not counting at == first_len
as being in the first half?
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.
if my ringbuf looks like [0, 1, 2, 3][4, 5, 6]
and at = 4
, then at == first_len
and at
is in the second half. More importantly: I don't want any of the elements in the first half.
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.
Well, either branch works if at == first_len
, but yeah, this approach is better.
@bors r+ 0571 |
⌛ Testing commit 05711ba with merge 492db7e... |
💔 Test failed - auto-mac-64-opt |
05711ba
to
e0978f8
Compare
Crap, I accidentally force pushed an old version of this branch on my compile station. Will fix when I get home. |
e0978f8
to
05711ba
Compare
Working on just knocking these out for all the collections so that there's something there.
💔 Test failed - auto-mac-64-nopt-t |
05711ba
to
3c18bc4
Compare
@bors r=huonw 3c18 |
Working on just knocking these out for all the collections so that there's something there.
Working on just knocking these out for all the collections so that there's something there.