mirror of
https://blitiri.com.ar/repos/chasquid
synced 2026-10-29 15:02:30 +00:00
Apply more mechanical simplifications using recent Go features
This is a follow-up on the `go fix` run in commit
0210c5fd92.
That commit recorded the automated updates.
This one applies further simplifications that are mechanical and do not
involve logic changes, but are outside of what `go fix` did.
It also removes some now-obsolete comments and statements.
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
||||
"html/template"
|
||||
"math"
|
||||
"net/http"
|
||||
"sort"
|
||||
"slices"
|
||||
"strconv"
|
||||
"time"
|
||||
)
|
||||
@@ -156,8 +156,8 @@ func allEvents(tr *trace) []traceAndEvent {
|
||||
evts := appendAllEvents(tr, []traceAndEvent{}, seen, 0)
|
||||
|
||||
// Sort them by time.
|
||||
sort.Slice(evts, func(i, j int) bool {
|
||||
return evts[i].Event.When.Before(evts[j].Event.When)
|
||||
slices.SortFunc(evts, func(a, b traceAndEvent) int {
|
||||
return a.Event.When.Compare(b.Event.When)
|
||||
})
|
||||
|
||||
return evts
|
||||
|
||||
Reference in New Issue
Block a user