Skip to content
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

Implement Clone::clone_from for LinkedList #64975

Merged
merged 3 commits into from
Oct 3, 2019
Merged

Implement Clone::clone_from for LinkedList #64975

merged 3 commits into from
Oct 3, 2019

Conversation

crgl
Copy link
Contributor

@crgl crgl commented Oct 1, 2019

See #28481. This represents a substantial speedup when the list sizes are comparable, and shouldn't ever be significantly worse. Technically split_off is doing an unnecessary search, but the code is hopefully cleaner as a result. I'm happy to rework anything that needs to be changed as well!

@rust-highfive
Copy link
Collaborator

r? @TimNN

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 1, 2019
@bluss
Copy link
Member

bluss commented Oct 2, 2019

It looks neat. It would be great to have a test for this in fact. If wanted it can be in a separate pr. With that this is r=me

@crgl
Copy link
Contributor Author

crgl commented Oct 2, 2019

I thought it might be better to add the test at the same time, but I could make separate pull requests if there are a lot of comments about the test. I thought this would be good because it tests all paths through the function, and it ensures both that the two lists are identical and that they haven't been altered from the original

@bluss
Copy link
Member

bluss commented Oct 2, 2019

@bors r+ rollup

Great!

@bors
Copy link
Contributor

bors commented Oct 2, 2019

📌 Commit 864e6fe has been approved by bluss

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 2, 2019
Manishearth added a commit to Manishearth/rust that referenced this pull request Oct 2, 2019
Implement Clone::clone_from for LinkedList

See rust-lang#28481. This represents a substantial speedup when the list sizes are comparable, and shouldn't ever be significantly worse. Technically split_off is doing an unnecessary search, but the code is hopefully cleaner as a result. I'm happy to rework anything that needs to be changed as well!
Centril added a commit to Centril/rust that referenced this pull request Oct 2, 2019
Implement Clone::clone_from for LinkedList

See rust-lang#28481. This represents a substantial speedup when the list sizes are comparable, and shouldn't ever be significantly worse. Technically split_off is doing an unnecessary search, but the code is hopefully cleaner as a result. I'm happy to rework anything that needs to be changed as well!
Centril added a commit to Centril/rust that referenced this pull request Oct 3, 2019
Implement Clone::clone_from for LinkedList

See rust-lang#28481. This represents a substantial speedup when the list sizes are comparable, and shouldn't ever be significantly worse. Technically split_off is doing an unnecessary search, but the code is hopefully cleaner as a result. I'm happy to rework anything that needs to be changed as well!
bors added a commit that referenced this pull request Oct 3, 2019
Rollup of 7 pull requests

Successful merges:

 - #63678 (Improve HRTB error span when -Zno-leak-check is used)
 - #64931 (Reword E0392 slightly)
 - #64959 (syntax: improve parameter without type suggestions)
 - #64975 (Implement Clone::clone_from for LinkedList)
 - #64993 (BacktraceStatus: add Eq impl)
 - #64998 (Filter out RLS output directories on tidy runs)
 - #65010 (Compare `primary` with maximum of `children`s' line num instead of dropping it)

Failed merges:

r? @ghost
@bors bors merged commit 864e6fe into rust-lang:master Oct 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants