diff options
| author | a <eddy@gfxlabs.io> | 2022-04-20 14:01:42 -0700 |
|---|---|---|
| committer | a <eddy@gfxlabs.io> | 2022-04-20 14:01:42 -0700 |
| commit | 1d6a9e66b608f77a0da9a6903802bb24ff0629d7 (patch) | |
| tree | 7f3e02d6e69d10913d882c5f87d9156001e1b77c /weed/shell/command_volume_check_disk.go | |
| parent | 846858fb436cc061c40c4f2565ed3682e3758596 (diff) | |
| parent | d1fd40358215a6237f51e0918659f74cc7269ff1 (diff) | |
| download | seaweedfs-1d6a9e66b608f77a0da9a6903802bb24ff0629d7.tar.xz seaweedfs-1d6a9e66b608f77a0da9a6903802bb24ff0629d7.zip | |
Merge branch 'master' into a
Diffstat (limited to 'weed/shell/command_volume_check_disk.go')
| -rw-r--r-- | weed/shell/command_volume_check_disk.go | 6 |
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] |
