Fixes useless capacity hint of 0 for map initialization.
Uses estimated capacity of len(values)/10 to reduce map
resizing operations.
Changes:
- Before: make(map[K][]V, 0) - capacity 0 is meaningless for maps
- After: make(map[K][]V, len(values)/10) - reasonable estimate
Impact:
- Reduces map resizing overhead during population
- Assumes ~10% unique keys (reasonable for grouping operations)
- May over-allocate for high cardinality, but acceptable trade-off
This is a minor optimization that avoids repeated map growth
when keys are added.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>