Reapply "[#972] Use slices.Sort* when useful"

This reverts commit 3359349acb.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2024-04-10 14:15:59 +03:00 committed by Evgenii Stratonikov
parent 2c4b50a71e
commit 669103a33e
2 changed files with 4 additions and 9 deletions

View file

@ -3,7 +3,7 @@ package control
import (
"bytes"
"fmt"
"sort"
"slices"
"strings"
rawclient "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client"
@ -177,9 +177,6 @@ func getShardIDListFromIDFlag(cmd *cobra.Command, withAllFlag bool) [][]byte {
res = append(res, raw)
}
sort.Slice(res, func(i, j int) bool {
return bytes.Compare(res[i], res[j]) < 0
})
slices.SortFunc(res, bytes.Compare)
return res
}