Skip to content

Commit

Permalink
ethdb/dbtest: use slices package for sorting (#27491)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Laine authored Jun 19, 2023
1 parent 289c6c3 commit 5d75123
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ethdb/dbtest/testsuite.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"testing"

"github.com/ethereum/go-ethereum/ethdb"
"golang.org/x/exp/slices"
)

// TestDatabaseSuite runs a suite of tests against a KeyValueStore database
Expand Down Expand Up @@ -526,7 +527,7 @@ func makeDataset(size, ksize, vsize int, order bool) ([][]byte, [][]byte) {
vals = append(vals, randBytes(vsize))
}
if order {
sort.Slice(keys, func(i, j int) bool { return bytes.Compare(keys[i], keys[j]) < 0 })
slices.SortFunc(keys, func(a, b []byte) bool { return bytes.Compare(a, b) < 0 })
}
return keys, vals
}

0 comments on commit 5d75123

Please sign in to comment.