]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: simplify some declarations
authorDaniel Martí <mvdan@mvdan.cc>
Wed, 11 Oct 2017 09:14:31 +0000 (10:14 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Sun, 15 Oct 2017 19:24:40 +0000 (19:24 +0000)
commit270a789c527bc6b43ed241f193d2d108b63fefa3
tree79a72c54e3cf672fb53eb1cac4995e05dc44afec
parente5b733570598646e9726d053db5a30114165f9d6
cmd/compile: simplify some declarations

Reduce the scope of some. Also remove vars that were simply the index or
the value in a range statement. While at it, remove a var that was
exactly the length of a slice.

Also replaced 'bad' with a more clear 'errored' of type bool, and
renamed a single-char name with a comment to a name that is
self-explanatory.

And removed a few unnecessary Index calls within loops.

Passes toolstash -cmp on std cmd.

Change-Id: I26eee5f04e8f7e5418e43e25dca34f89cca5c80a
Reviewed-on: https://go-review.googlesource.com/70930
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/fmt.go
src/cmd/compile/internal/gc/noder.go
src/cmd/compile/internal/gc/order.go
src/cmd/compile/internal/gc/reflect.go
src/cmd/compile/internal/gc/sinit.go
src/cmd/compile/internal/gc/subr.go
src/cmd/compile/internal/gc/typecheck.go
src/cmd/compile/internal/gc/walk.go