Unverified Commit 5d75123c authored by Dan Laine's avatar Dan Laine Committed by GitHub

ethdb/dbtest: use slices package for sorting (#27491)

parent 289c6c3b
...@@ -24,6 +24,7 @@ import ( ...@@ -24,6 +24,7 @@ import (
"testing" "testing"
"github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/ethdb"
"golang.org/x/exp/slices"
) )
// TestDatabaseSuite runs a suite of tests against a KeyValueStore database // TestDatabaseSuite runs a suite of tests against a KeyValueStore database
...@@ -526,7 +527,7 @@ func makeDataset(size, ksize, vsize int, order bool) ([][]byte, [][]byte) { ...@@ -526,7 +527,7 @@ func makeDataset(size, ksize, vsize int, order bool) ([][]byte, [][]byte) {
vals = append(vals, randBytes(vsize)) vals = append(vals, randBytes(vsize))
} }
if order { 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 return keys, vals
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment