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

Do not iterate to drop if empty #182

Merged
merged 1 commit into from
Aug 4, 2020
Merged

Conversation

jonhoo
Copy link
Contributor

@jonhoo jonhoo commented Aug 3, 2020

If the table is empty, there is no need to iterate over all the buckets
in order to drop their contents.

Fixes #170.

If the table is empty, there is no need to iterate over all the buckets
in order to drop their contents.

Fixes rust-lang#170.
@Amanieu
Copy link
Member

Amanieu commented Aug 4, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Aug 4, 2020

📌 Commit 284960c has been approved by Amanieu

@bors
Copy link
Contributor

bors commented Aug 4, 2020

⌛ Testing commit 284960c with merge 7593ec9...

@bors
Copy link
Contributor

bors commented Aug 4, 2020

☀️ Test successful - checks-travis
Approved by: Amanieu
Pushing 7593ec9 to master...

@bors bors merged commit 7593ec9 into rust-lang:master Aug 4, 2020
@jonhoo jonhoo deleted the fast-drop-empty branch August 4, 2020 12:51
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 9, 2020
Update hashbrown to 0.8.2

Includes:
- Avoid closures to improve compile times (rust-lang/hashbrown#183)
- Do not iterate to drop if empty (rust-lang/hashbrown#182)

r? @Mark-Simulacrum
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.

Dropping empty map takes time proportional to capacity
3 participants