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 <cuong.manhle.vn@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
import (
"fmt"
"os"
+ "slices"
"strings"
)
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
}