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

ds: Add hmcap/shcap macros #1747

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

carter-thaxton
Copy link

Occasionally, I've found it useful to know the capacity of a hashmap.
This adds a very simple interface, exposing this property.

Ideally, there would also be a public API for hmsetcap / shsetcap, which is useful when initializing a hashmap with a known number of values without reallocating. I can add that in another PR, assuming this first PR is considered appropriate.

Also fix the wording of "total number of elements" vs "number of total elements", (which makes it sounds like chemistry?).

Thank you for this excellent small library! I've used it in several projects over the years.

Also fix grammar for 'total number of elements'
@carter-thaxton carter-thaxton changed the title Add hmcap/shcap macros ds: Add hmcap/shcap macros Feb 15, 2025
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.

1 participant