Skip to content

Conversation

ChayimFriedman2
Copy link
Contributor

This saves a whole lot 0.127 seconds in rust-analyzer prime-caches .!

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 25, 2025
@ChayimFriedman2 ChayimFriedman2 added this pull request to the merge queue Apr 25, 2025
Merged via the queue into rust-lang:master with commit df594ba Apr 25, 2025
14 checks passed
@ChayimFriedman2 ChayimFriedman2 deleted the preallocate-input branch April 25, 2025 14:47
pub fn with_capacity(capacity: usize) -> Self {
Self {
kind: Vec::with_capacity(capacity),
joint: Vec::with_capacity(capacity / size_of::<bits>()),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this round upwards ((capacity + size_of::<bits>() - 1) / size_of::<bits>())?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants