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

Conversation

@crgl
Copy link
Contributor

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

This comment has been minimized.

Copy link
Collaborator

commented Oct 1, 2019

r? @TimNN

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

@bluss

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Member

commented Oct 2, 2019

@bors r+ rollup

Great!

@bors

This comment has been minimized.

Copy link
Contributor

commented Oct 2, 2019

📌 Commit 864e6fe has been approved by bluss

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!
bors added a commit that referenced this pull request Oct 2, 2019
Rollup of 7 pull requests

Successful merges:

 - #64749 (Fix most remaining Polonius test differences)
 - #64906 (Add support for `const unsafe? extern fn`)
 - #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
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 Centril referenced this pull request Oct 2, 2019
bors added a commit that referenced this pull request Oct 2, 2019
Rollup of 7 pull requests

Successful merges:

 - #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)
 - #64999 (extract expected return type for async fn generators)
 - #65010 (Compare `primary` with maximum of `children`s' line num instead of dropping it)

Failed merges:

r? @ghost
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!
@Centril Centril referenced this pull request Oct 3, 2019
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
4 checks passed
4 checks passed
pr Build #20191002.75 succeeded
Details
pr (Linux mingw-check) Linux mingw-check succeeded
Details
pr (Linux x86_64-gnu-llvm-6.0) Linux x86_64-gnu-llvm-6.0 succeeded
Details
pr (LinuxTools) LinuxTools succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.