Skip to content

Commit

Permalink
*: use std/slices to replace exp/slices (#46339)
Browse files Browse the repository at this point in the history
ref #45933
  • Loading branch information
hawkingrei authored Aug 23, 2023
1 parent 6169cce commit 14fb817
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions executor/sample.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package executor

import (
"context"
"slices"

"github.com/pingcap/errors"
"github.com/pingcap/tidb/executor/internal/exec"
Expand All @@ -31,7 +32,6 @@ import (
decoder "github.com/pingcap/tidb/util/rowDecoder"
"github.com/pingcap/tidb/util/tracing"
"github.com/tikv/client-go/v2/tikv"
"golang.org/x/exp/slices"
)

var _ exec.Executor = &TableSampleExecutor{}
Expand Down Expand Up @@ -227,12 +227,12 @@ func splitIntoMultiRanges(store kv.Storage, startKey, endKey kv.Key) ([]kv.KeyRa
}

func sortRanges(ranges []kv.KeyRange, isDesc bool) {
slices.SortFunc(ranges, func(i, j kv.KeyRange) bool {
slices.SortFunc(ranges, func(i, j kv.KeyRange) int {
ir, jr := i.StartKey, j.StartKey
if !isDesc {
return ir.Cmp(jr) < 0
return ir.Cmp(jr)
}
return ir.Cmp(jr) > 0
return -ir.Cmp(jr)
})
}

Expand Down

0 comments on commit 14fb817

Please sign in to comment.