cmd/...: remove use of func() { ... }() in loop increment

These were introduced during C -> Go translation when the loop increment
contained multiple statements.

Change-Id: Ic8abd8dcb3308851a1f7024de00711f0f984e684
Reviewed-on: https://go-review.googlesource.com/7627
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
Russ Cox 2015-03-09 00:31:13 -04:00
parent 01512b3edb
commit d7f6d46c5c
14 changed files with 30 additions and 27 deletions

View file

@ -83,7 +83,7 @@ func walkstmtlist(l *NodeList) {
}
func samelist(a *NodeList, b *NodeList) bool {
for ; a != nil && b != nil; (func() { a = a.Next; b = b.Next })() {
for ; a != nil && b != nil; a, b = a.Next, b.Next {
if a.N != b.N {
return false
}
@ -1651,7 +1651,7 @@ func ascompatee(op int, nl *NodeList, nr *NodeList, init **NodeList) *NodeList {
var nn *NodeList
ll = nl
lr = nr
for ; ll != nil && lr != nil; (func() { ll = ll.Next; lr = lr.Next })() {
for ; ll != nil && lr != nil; ll, lr = ll.Next, lr.Next {
// Do not generate 'x = x' during return. See issue 4014.
if op == ORETURN && ll.N == lr.N {
continue