Skip to content

Commit 46b576b

Browse files
pixel365gopherbot
authored andcommitted
net/http/pprof: replace sort.Slice with slices.SortFunc
Change-Id: Ie416ed0d7abcb64e63d999b8cee5975a0fc13875 Reviewed-on: https://go-review.googlesource.com/c/go/+/622496 Auto-Submit: Ian Lance Taylor <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Commit-Queue: Ian Lance Taylor <[email protected]> Reviewed-by: Cherry Mui <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 4bf9818 commit 46b576b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/net/http/pprof/pprof.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ import (
8686
"runtime"
8787
"runtime/pprof"
8888
"runtime/trace"
89-
"sort"
89+
"slices"
9090
"strconv"
9191
"strings"
9292
"time"
@@ -413,8 +413,8 @@ func Index(w http.ResponseWriter, r *http.Request) {
413413
})
414414
}
415415

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

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

0 commit comments

Comments
 (0)