mirror of
https://github.com/golang/go.git
synced 2026-01-29 07:02:05 +03:00
cmd/compile: cleanup useless if statement in prove
Change-Id: Icf5db366b311b5f88809dd07f22cf4bfdead516c Reviewed-on: https://go-review.googlesource.com/c/go/+/721203 Reviewed-by: Keith Randall <khr@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Jorropo <jorropo.pgm@gmail.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Mark Freeman <markfreeman@google.com>
This commit is contained in:
@@ -3030,16 +3030,14 @@ func (ft *factsTable) topoSortValuesInBlock(b *Block) {
|
||||
want := f.NumValues()
|
||||
|
||||
scores := ft.reusedTopoSortScoresTable
|
||||
if len(scores) < want {
|
||||
if want <= cap(scores) {
|
||||
scores = scores[:want]
|
||||
} else {
|
||||
if cap(scores) > 0 {
|
||||
f.Cache.freeUintSlice(scores)
|
||||
}
|
||||
scores = f.Cache.allocUintSlice(want)
|
||||
ft.reusedTopoSortScoresTable = scores
|
||||
if want <= cap(scores) {
|
||||
scores = scores[:want]
|
||||
} else {
|
||||
if cap(scores) > 0 {
|
||||
f.Cache.freeUintSlice(scores)
|
||||
}
|
||||
scores = f.Cache.allocUintSlice(want)
|
||||
ft.reusedTopoSortScoresTable = scores
|
||||
}
|
||||
|
||||
for _, v := range b.Values {
|
||||
|
||||
Reference in New Issue
Block a user