From 5d75123cb7804feb385f025eafba83594076e6a2 Mon Sep 17 00:00:00 2001 From: Dan Laine Date: Mon, 19 Jun 2023 01:48:47 -0400 Subject: [PATCH] ethdb/dbtest: use slices package for sorting (#27491) --- ethdb/dbtest/testsuite.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ethdb/dbtest/testsuite.go b/ethdb/dbtest/testsuite.go index d82dbd699..ac10ddde9 100644 --- a/ethdb/dbtest/testsuite.go +++ b/ethdb/dbtest/testsuite.go @@ -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 @@ -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 }