Name |
Last commit
|
Last update |
---|---|---|
.. | ||
arrayclear.go | ||
cmpstring.go | ||
dg.exp | ||
err-1.go | ||
goto-1.go | ||
mapclear.go | ||
mapstring.go | ||
undef-1.go |
If a string([]byte) conversion is used immediately as a key for a map read, we don't need to copy the backing store of the byte slice, as mapaccess does not keep a reference to it. The gc compiler does more than this: it also avoids the copy if the map key is a composite literal that contains the conversion as a field, like, T{ ... { ..., string(b), ... }, ... }. For now, we just optimize the simple case, which is probably most common. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/176197 * go.dg/mapstring.go: New test. From-SVN: r271044
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
arrayclear.go | Loading commit data... | |
cmpstring.go | Loading commit data... | |
dg.exp | Loading commit data... | |
err-1.go | Loading commit data... | |
goto-1.go | Loading commit data... | |
mapclear.go | Loading commit data... | |
mapstring.go | Loading commit data... | |
undef-1.go | Loading commit data... |