Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions cmd/testbeacon.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"os"
"path/filepath"
"slices"
"sort"
"strconv"
"strings"
"sync"
Expand Down Expand Up @@ -1829,9 +1828,7 @@ func generateSimulationValues(s []time.Duration, endpoint string) SimulationValu

sorted := make([]time.Duration, len(s))
copy(sorted, s)
sort.Slice(sorted, func(i, j int) bool {
return sorted[i] < sorted[j]
})
slices.Sort(sorted)
minVal := sorted[0]
maxVal := sorted[len(s)-1]
medianVal := sorted[len(s)/2]
Expand Down
5 changes: 2 additions & 3 deletions core/consensus/qbft/strategysim_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"math/rand"
"os"
"runtime"
"slices"
"sort"
"strings"
"sync"
Expand Down Expand Up @@ -759,9 +760,7 @@ func quorumDecidedDuration(results []result) time.Duration {
panic("not enough durations")
}

sort.Slice(durations, func(i, j int) bool {
return durations[i] < durations[j]
})
slices.Sort(durations)

return durations[q-1]
}
Expand Down
5 changes: 1 addition & 4 deletions testutil/beaconmock/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"math/big"
"net/http"
"slices"
"sort"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -368,9 +367,7 @@ func WithDeterministicProposerDuties(factor int) Option {

valIdxs := vals.Indices()

sort.Slice(valIdxs, func(i, j int) bool {
return valIdxs[i] < valIdxs[j]
})
slices.Sort(valIdxs)

slotsPerEpoch, err := mock.SlotsPerEpoch(ctx)
if err != nil {
Expand Down
Loading