[dev.ssa] cmd/internal/ssa: minor cleanup

These were review comments for CL 6681 that didn't get sent in time.

Change-Id: If161af3655770487f3ba34535d3fb55dbfde7917
Reviewed-on: https://go-review.googlesource.com/7644
Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
Josh Bleecher Snyder 2015-03-16 16:31:13 -07:00
parent f52b234579
commit 7c2c0b4e53
4 changed files with 18 additions and 8 deletions

View file

@ -86,8 +86,10 @@ func deadcode(f *Func) {
f.vid.put(v.ID)
}
}
for j := i; j < len(b.Values); j++ {
b.Values[j] = nil // aid GC
// aid GC
tail := b.Values[i:]
for j := range tail {
tail[j] = nil
}
b.Values = b.Values[:i]
}
@ -105,9 +107,10 @@ func deadcode(f *Func) {
f.bid.put(b.ID)
}
}
// zero remainder to help gc
for j := i; j < len(f.Blocks); j++ {
f.Blocks[j] = nil
// zero remainder to help GC
tail := f.Blocks[i:]
for j := range tail {
tail[j] = nil
}
f.Blocks = f.Blocks[:i]