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

Avoid iteration when dropping HashMaps whose items don't need dropping #31718

Merged
merged 1 commit into from
Feb 17, 2016
Merged

Avoid iteration when dropping HashMaps whose items don't need dropping #31718

merged 1 commit into from
Feb 17, 2016

Conversation

apasel422
Copy link
Contributor

This changes the performance of drop from linear to constant time for such HashMaps.

Closes #31711.

r? @bluss

This changes the performance of `drop` from linear to constant time for
such `HashMap`s.

Closes #31711.
@bluss
Copy link
Member

bluss commented Feb 17, 2016

Cool! This is similar to the recently added conditional in Vec's Drop (#28531), but in this case it impacts both debug and release mode (the loop is never optimized out).

@bluss
Copy link
Member

bluss commented Feb 17, 2016

@bors r+ f890772

@bors
Copy link
Contributor

bors commented Feb 17, 2016

⌛ Testing commit f890772 with merge b9be526...

@bors
Copy link
Contributor

bors commented Feb 17, 2016

💔 Test failed - auto-win-gnu-32-nopt-t

@arielb1
Copy link
Contributor

arielb1 commented Feb 17, 2016

@bors retry

@bors
Copy link
Contributor

bors commented Feb 17, 2016

⌛ Testing commit f890772 with merge 2051a92...

bors added a commit that referenced this pull request Feb 17, 2016
This changes the performance of `drop` from linear to constant time for such `HashMap`s.

Closes #31711.

r? @bluss
@bors bors merged commit f890772 into rust-lang:master Feb 17, 2016
@apasel422 apasel422 deleted the issue-31711 branch February 17, 2016 19:17
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.

4 participants