Y
Hacker News
new
|
ask
|
show
|
jobs
by
BarkMore
2545 days ago
The compiler optimizes conversion from []byte to string on map lookup.
https://github.com/golang/go/commit/f5f5a8b6209f84961687d993...
2 comments
ryanworl
2545 days ago
That’s awesome! I’ll have to benchmark that and see if I can delete some code now. Thanks.
link
Zach_the_Lizard
2545 days ago
It 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.
link