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