Skip to content

Use getOrPut for add - #31

Merged
deckarep merged 4 commits into
deckarep:mainfrom
PauSolerValades:enhanced-add
Oct 2, 2026
Merged

deckarep merged 4 commits into
deckarep:mainfrom
PauSolerValades:enhanced-add

Conversation

@PauSolerValades

Copy link
Copy Markdown
Contributor

Hello! I was checking the hash api from the std and I obesved that the getOrPut function does exactly what add does to without invoking two counts. It looks cleaner to me, but I don't really know if it's faster or actually better (have not benchmark it at all), but it could be worth looking into.

@deckarep
deckarep merged commit 3818055 into deckarep:main Oct 2, 2026
1 check passed
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