Skip to content

Conversation

bluss
Copy link
Contributor

@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
Contributor

r? @sfackler

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

@alexcrichton
Copy link
Member

@bors: r+

Thanks!

@bors
Copy link
Collaborator

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