top | item 20321349

(no title)

BarkMore | 6 years ago

The compiler optimizes conversion from []byte to string on map lookup. https://github.com/golang/go/commit/f5f5a8b6209f84961687d993...

discuss

order

ryanworl|6 years ago

That’s awesome! I’ll have to benchmark that and see if I can delete some code now. Thanks.

Zach_the_Lizard|6 years 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.