3 ms·
The compiler optimizes conversion from []byte to string on map lookup. https://github.com/golang/go/commit/f5f5a8b6209f84961687d993b93ea0d397f5d5bf https://git
by BarkMore 7y ago
The compiler optimizes conversion from []byte to string on map lookup.
https://github.com/golang/go/commit/f5f5a8b6209f84961687d993b93ea0d397f5d5bf https://github.com/golang/go/commit/f5f5a8b6209f84961687d993...
- ryanworl 7y agoThat’s awesome! I’ll have to benchmark that and see if I can delete some code now. Thanks.
- Zach_the_Lizard 7y agoIt doesn't seem to do it in the general non-map, non-mutation case, though this optimization is welcome. I've personally resorted to using `unsafe` trickery in tight loops to overcome this limitation.