]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/internal/obj/arm64: delete needless closure in for claus
authorRob Pike <r@golang.org>
Mon, 30 Mar 2015 22:06:33 +0000 (15:06 -0700)
committerRob Pike <r@golang.org>
Mon, 30 Mar 2015 22:36:43 +0000 (22:36 +0000)
A residue of the automatic translation, this closure is easily rewritten
to a simpler, smaller, and faster construct.

Discovered while analyzing #10269, which I still plan to fix.

Change-Id: I76b12290280d81880c446b4cf75da633a94482d4
Reviewed-on: https://go-review.googlesource.com/8270
Reviewed-by: Dave Cheney <dave@cheney.net>
Reviewed-by: Minux Ma <minux@golang.org>
src/cmd/internal/obj/arm64/obj7.go

index dfba86ccb9e46ff2a6661fbfca98e08953cc1bfa..a9f8d4733936b090a94ae43611e2d43aa1f66fc5 100644 (file)
@@ -361,7 +361,7 @@ loop:
        if p.Mark&FOLL != 0 {
                i = 0
                q = p
-               for ; i < 4; (func() { i++; q = q.Link })() {
+               for ; i < 4; i, q = i+1, q.Link {
                        if q == *last || q == nil {
                                break
                        }