]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/gc: don't iterate over field list twice
authorDave Cheney <dave@cheney.net>
Wed, 30 Mar 2016 23:30:04 +0000 (10:30 +1100)
committerDave Cheney <dave@cheney.net>
Thu, 31 Mar 2016 00:21:37 +0000 (00:21 +0000)
commit0373128318f0a64ea0c8e1a156d69d2cacbd2591
tree1be8a3967a49e67829306d8874845fab582108a9
parente76fc1b921e421bcbed66194946ecca8d49f8aac
cmd/compile/internal/gc: don't iterate over field list twice

In tostruct0 and tofunargs we take a list of nodes, transform them into
a slice of Fields, set the fields on a type, then use the IterFields
iterator to iterate over the list again to see if any of them are
broken.

As we know the slice of fielde-we just created it-we can combine these two
interations into one pass over the fields.

Change-Id: I8b04c90fb32fd6c3b1752cfc607128a634ee06c5
Reviewed-on: https://go-review.googlesource.com/21350
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/compile/internal/gc/dcl.go