Skip to content

Commit

Permalink
cmd/compile/internal/liveness: use slices.Reverse
Browse files Browse the repository at this point in the history
Now that we're bootstrapping from a toolchain that has the slices
package.

Updates #64751

Change-Id: Id50d76de05e353ef06d64b47ad6400b2b7572205
Reviewed-on: https://go-review.googlesource.com/c/go/+/610775
Auto-Submit: Cuong Manh Le <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Cherry Mui <[email protected]>
  • Loading branch information
cuonglm authored and gopherbot committed Sep 4, 2024
1 parent a570823 commit e7047bd
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/cmd/compile/internal/liveness/intervals.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ package liveness
import (
"fmt"
"os"
"slices"
"strings"
)

Expand Down Expand Up @@ -131,11 +132,7 @@ func (c *IntervalsBuilder) setLast(x int) {

func (c *IntervalsBuilder) Finish() (Intervals, error) {
// Reverse intervals list and check.
// FIXME: replace with slices.Reverse once the
// bootstrap version supports it.
for i, j := 0, len(c.s)-1; i < j; i, j = i+1, j-1 {
c.s[i], c.s[j] = c.s[j], c.s[i]
}
slices.Reverse(c.s)
if err := check(c.s); err != nil {
return Intervals{}, err
}
Expand Down

0 comments on commit e7047bd

Please sign in to comment.