Skip to content

Commit

Permalink
net/http/pprof: replace sort.Slice with slices.SortFunc
Browse files Browse the repository at this point in the history
Change-Id: Ie416ed0d7abcb64e63d999b8cee5975a0fc13875
Reviewed-on: https://go-review.googlesource.com/c/go/+/622496
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
  • Loading branch information
pixel365 authored and gopherbot committed Oct 25, 2024
1 parent 4bf9818 commit 46b576b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/net/http/pprof/pprof.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ import (
"runtime"
"runtime/pprof"
"runtime/trace"
"sort"
"slices"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -413,8 +413,8 @@ func Index(w http.ResponseWriter, r *http.Request) {
})
}

sort.Slice(profiles, func(i, j int) bool {
return profiles[i].Name < profiles[j].Name
slices.SortFunc(profiles, func(a, b profileEntry) int {
return strings.Compare(a.Name, b.Name)
})

if err := indexTmplExecute(w, profiles); err != nil {
Expand Down

0 comments on commit 46b576b

Please sign in to comment.