mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00: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:
parent
2239520d1c
commit
e64023dcbf
1 changed files with 7 additions and 9 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue