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>
diff --git a/src/cmd/internal/gc/subr.go b/src/cmd/internal/gc/subr.go
index ec4958a..7786a68 100644
--- a/src/cmd/internal/gc/subr.go
+++ b/src/cmd/internal/gc/subr.go
@@ -1009,7 +1009,7 @@
TSTRUCT:
t1 = t1.Type
t2 = t2.Type
- for ; t1 != nil && t2 != nil; (func() { t1 = t1.Down; t2 = t2.Down })() {
+ for ; t1 != nil && t2 != nil; t1, t2 = t1.Down, t2.Down {
if t1.Etype != TFIELD || t2.Etype != TFIELD {
Fatal("struct/interface missing field: %v %v", Tconv(t1, 0), Tconv(t2, 0))
}
@@ -1027,7 +1027,7 @@
case TFUNC:
t1 = t1.Type
t2 = t2.Type
- for ; t1 != nil && t2 != nil; (func() { t1 = t1.Down; t2 = t2.Down })() {
+ for ; t1 != nil && t2 != nil; t1, t2 = t1.Down, t2.Down {
var ta *Type
var tb *Type
@@ -1038,7 +1038,7 @@
// Loop over fields in structs, ignoring argument names.
ta = t1.Type
tb = t2.Type
- for ; ta != nil && tb != nil; (func() { ta = ta.Down; tb = tb.Down })() {
+ for ; ta != nil && tb != nil; ta, tb = ta.Down, tb.Down {
if ta.Etype != TFIELD || tb.Etype != TFIELD {
Fatal("func struct missing field: %v %v", Tconv(ta, 0), Tconv(tb, 0))
}