mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: add Key, FieldSlice, and SetFields helpers
Allows safely eliminating more direct uses of Type's Type and Down fields. Passes toolstash -cmp. Change-Id: I5c17fe541a0473c3cd2978d8314c4ab759079a61 Reviewed-on: https://go-review.googlesource.com/20541 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
0b281872e6
commit
1c2bdfb7d9
12 changed files with 106 additions and 106 deletions
|
|
@ -979,7 +979,7 @@ func maplit(ctxt int, n *Node, var_ *Node, init *Nodes) {
|
|||
// build list of var[c] = expr.
|
||||
// use temporary so that mapassign1 can have addressable key, val.
|
||||
if key == nil {
|
||||
key = temp(var_.Type.Down)
|
||||
key = temp(var_.Type.Key())
|
||||
val = temp(var_.Type.Type)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue