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:
Jorropo 2025-11-18 01:18:30 +01:00 committed by Gopher Robot
parent 2239520d1c
commit e64023dcbf

View file

@ -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 {