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

List constructor creates a buffer with capacity exactly the expected number of elements. #248

Merged
merged 2 commits into from
May 24, 2024

Conversation

bruno-roustant
Copy link
Collaborator

When calling the constructor, the caller often expects to create a list of capacity exactly the requested one to not waste space. But if we let the resizer choose a size, the capacity will be higher.

Copy link
Member

@dweiss dweiss left a comment

Choose a reason for hiding this comment

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

Makes sense.

@dweiss dweiss added this to the 0.10.0 milestone May 24, 2024
@bruno-roustant bruno-roustant merged commit ccc36af into carrotsearch:master May 24, 2024
2 checks passed
@bruno-roustant bruno-roustant deleted the list_capacity branch May 24, 2024 13:34
@dweiss
Copy link
Member

dweiss commented May 24, 2024

Thank you, @bruno-roustant ! I'll prepare a release next week?

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.

2 participants