diff options
| author | Marvin Stenger <marvin.stenger94@gmail.com> | 2016-03-23 16:35:50 +0100 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2016-03-23 22:49:49 +0000 |
| commit | bd83cc6dae36399f3c8fd99bd4ceea6570c70f5a (patch) | |
| tree | a33c6d22b6afeb5e575ed6bc4f1d42ce7e07cebf /src/cmd/compile/internal/ssa/stackalloc.go | |
| parent | ca5417b8e0c859aa5537247aed03316bfd3f5a66 (diff) | |
| download | go-bd83cc6dae36399f3c8fd99bd4ceea6570c70f5a.tar.xz | |
cmd/compile: prettify loop iterations
This commit replaces some of
for i := len(x) - 1; i >= 0; i-- {...}
style loops, which do not rely on reverse iteration order.
Change-Id: I5542834286562da058200c06e7a173b13760e54d
Reviewed-on: https://go-review.googlesource.com/21044
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/ssa/stackalloc.go')
| -rw-r--r-- | src/cmd/compile/internal/ssa/stackalloc.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/ssa/stackalloc.go b/src/cmd/compile/internal/ssa/stackalloc.go index 253c83f163..ad8b7be9ba 100644 --- a/src/cmd/compile/internal/ssa/stackalloc.go +++ b/src/cmd/compile/internal/ssa/stackalloc.go @@ -155,7 +155,7 @@ func (s *stackAllocState) stackalloc() { slots = make([]int, n) s.slots = slots } - for i := f.NumValues() - 1; i >= 0; i-- { + for i := range slots { slots[i] = -1 } |
