aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_volume_check_disk.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/shell/command_volume_check_disk.go')
-rw-r--r--weed/shell/command_volume_check_disk.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/weed/shell/command_volume_check_disk.go b/weed/shell/command_volume_check_disk.go
index 54edd53dd..53284096d 100644
--- a/weed/shell/command_volume_check_disk.go
+++ b/weed/shell/command_volume_check_disk.go
@@ -9,9 +9,9 @@ import (
"github.com/chrislusf/seaweedfs/weed/pb"
"github.com/chrislusf/seaweedfs/weed/pb/volume_server_pb"
"github.com/chrislusf/seaweedfs/weed/storage/needle_map"
+ "golang.org/x/exp/slices"
"io"
"math"
- "sort"
)
func init() {
@@ -70,8 +70,8 @@ func (c *commandVolumeCheckDisk) Do(args []string, commandEnv *CommandEnv, write
}
for _, replicas := range volumeReplicas {
- sort.Slice(replicas, func(i, j int) bool {
- return fileCount(replicas[i]) > fileCount(replicas[j])
+ slices.SortFunc(replicas, func(a, b *VolumeReplica) bool {
+ return fileCount(a) > fileCount(b)
})
for len(replicas) >= 2 {
a, b := replicas[0], replicas[1]