]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: cleanup useless if statement in prove
authorJorropo <jorropo.pgm@gmail.com>
Tue, 18 Nov 2025 00:18:30 +0000 (01:18 +0100)
committerGopher Robot <gobot@golang.org>
Wed, 19 Nov 2025 21:33:55 +0000 (13:33 -0800)
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>
src/cmd/compile/internal/ssa/prove.go

index 4b2cedc8be9b98c05212efb57486896892bafeb4..789d7721d42b889665fa7e6a2d1800c21a4d6de1 100644 (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 {