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

vec: Write the .extend() specialization in cleaner style #37709

Merged
merged 1 commit into from
Nov 12, 2016

Conversation

bluss
Copy link
Member

@bluss bluss commented Nov 11, 2016

As far as possible, use regular default fn specialization in favour of
ad-hoc conditionals.

No intentional functional change. Code quality was validated against the same
benchmarks that were used in initial trusted len development.

This change is prompted by taking impressions from
#27749 (comment)

As far as possible, use regular `default fn` specialization in favour of
ad-hoc conditionals.
@rust-highfive
Copy link
Collaborator

r? @sfackler

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

@alexcrichton
Copy link
Member

@bors: r+

Thanks!

@bors
Copy link
Contributor

bors commented Nov 11, 2016

📌 Commit 5058e58 has been approved by alexcrichton

eddyb added a commit to eddyb/rust that referenced this pull request Nov 11, 2016
…chton

vec: Write the .extend() specialization in cleaner style

As far as possible, use regular `default fn` specialization in favour of
ad-hoc conditionals.

No intentional functional change. Code quality was validated against the same
benchmarks that were used in initial trusted len development.

This change is prompted by taking impressions from
rust-lang#27749 (comment)
eddyb added a commit to eddyb/rust that referenced this pull request Nov 12, 2016
…chton

vec: Write the .extend() specialization in cleaner style

As far as possible, use regular `default fn` specialization in favour of
ad-hoc conditionals.

No intentional functional change. Code quality was validated against the same
benchmarks that were used in initial trusted len development.

This change is prompted by taking impressions from
rust-lang#27749 (comment)
bors added a commit that referenced this pull request Nov 12, 2016
@bors bors merged commit 5058e58 into rust-lang:master Nov 12, 2016
@bluss bluss deleted the cleaner-vec-extend branch November 12, 2016 23:21
bors added a commit that referenced this pull request Nov 14, 2016
Restore Vec::from_iter() specialization

Since I said "no intentional functional change" in the previous commit,
I guess it was inevitable there were unintentional changes. Not
functional, but optimization-wise. This restores the extend
specialization's use in Vec::from_iter. (commit 1).

Also use specialization in from_iter to reduce allocation code duplication
for the TrustedLen case (commit 2).

Bug introduced in PR #37709
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