cmd/link/internal/ld: simple cleanups

Simplify some C-style loops with range statements, and move some
declarations closer to their uses.

While at it, ensure that all the SymbolType consts are typed.

Change-Id: I04b06afb2c1fb249ef8093a0c5cca0a597d1e05c
Reviewed-on: https://go-review.googlesource.com/105217
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Daniel Martí 2018-04-06 21:41:06 +01:00
parent ae2a2d12f6
commit a6b183fabd
8 changed files with 47 additions and 68 deletions

View file

@ -295,7 +295,7 @@ func (d *deadcodepass) flood() {
mpos := 0 // 0-3, the R_METHODOFF relocs of runtime.uncommontype
var methods []methodref
for i := 0; i < len(s.R); i++ {
for i := range s.R {
r := &s.R[i]
if r.Sym == nil {
continue