mirror of
https://codeberg.org/ziglang/zig
synced 2026-11-18 07:05:05 +00:00
std.HashMap: cleanup ensureCapacity + add test
- Cleaned up some comments - Removed the "is power of two" check from optimizedCapacity since the * 5 / 3 is unlikely to end up with a power of two, so it's a wasted check the majority of the time - Made ensureCapacity/ensureCapacityExact increment the modification count if they resize the hash map so that we can catch resizes while iterating, which would likely break the iterator state
This commit is contained in:
parent
13a7b8586a
commit
cf8dde2d68
1 changed files with 23 additions and 8 deletions
Loading…
Add table
Add a link
Reference in a new issue