mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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 <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>
This commit is contained in:
parent
4bf98186b5
commit
46b576be72
1 changed files with 3 additions and 3 deletions
|
|
@ -86,7 +86,7 @@ import (
|
|||
"runtime"
|
||||
"runtime/pprof"
|
||||
"runtime/trace"
|
||||
"sort"
|
||||
"slices"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue