Remove default `const I: usize = 0` from AutoMap/AutoSet and reorder before H
The default `const I: usize = 0` parameter is a footgun because there's
almost always a better value. This removes the default and reorders `I`
before `H` so callers can write `AutoMap<K, V, 1>` without specifying
the hasher.
Each callsite now uses the largest `I` that doesn't increase struct size
on the stack: `I = floor(16 / sizeof((K, V)))`. This also fixes some
existing suboptimal values (e.g. cell_counters I=8→2, TaskIdSet I=2→4).
Co-Authored-By:
Claude <noreply@anthropic.com>
Showing
This diff is collapsed.
Please
register
or
sign in
to comment