Skip to content

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

Merged
merged 2 commits into from
Feb 15, 2015
Merged

Conversation

Gankra
Copy link
Contributor

@Gankra Gankra commented Feb 7, 2015

Working on just knocking these out for all the collections so that there's something there.

@Gankra
Copy link
Contributor Author

Gankra commented Feb 7, 2015

r? @huonw

@rust-highfive rust-highfive assigned huonw and unassigned brson Feb 7, 2015
@rust-highfive
Copy link
Contributor

r? @brson

(rust_highfive has picked a reviewer for you, use r? to override)

@Gankra
Copy link
Contributor Author

Gankra commented Feb 7, 2015

Found an error, retesting

@Gankra
Copy link
Contributor Author

Gankra commented Feb 8, 2015

All fixed.

let first_len = first_half.len();
let second_len = second_half.len();
if at < first_len {
// `at` lies in the first half.
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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.

@huonw
Copy link
Member

huonw commented Feb 13, 2015

@bors r+ 0571

@bors
Copy link
Collaborator

bors commented Feb 13, 2015

⌛ Testing commit 05711ba with merge 492db7e...

@bors
Copy link
Collaborator

bors commented Feb 13, 2015

💔 Test failed - auto-mac-64-opt

@Gankra
Copy link
Contributor Author

Gankra commented Feb 13, 2015

Crap, I accidentally force pushed an old version of this branch on my compile station. Will fix when I get home.

bors added a commit that referenced this pull request Feb 14, 2015
Working on just knocking these out for all the collections so that there's something there.
@bors
Copy link
Collaborator

bors commented Feb 14, 2015

⌛ Testing commit 05711ba with merge 2ce55b6...

@bors
Copy link
Collaborator

bors commented Feb 14, 2015

💔 Test failed - auto-mac-64-nopt-t

@Gankra
Copy link
Contributor Author

Gankra commented Feb 15, 2015

@bors r=huonw 3c18

bors added a commit that referenced this pull request Feb 15, 2015
Working on just knocking these out for all the collections so that there's something there.
@bors
Copy link
Collaborator

bors commented Feb 15, 2015

⌛ Testing commit 3c18bc4 with merge 5be210c...

@bors bors merged commit 3c18bc4 into rust-lang:master Feb 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants