This reverts commit 2e5aa06026, reversing
changes made to 4d414f54a2.
This commit is contained in:
chrislu
2023-09-18 16:12:50 -07:00
parent 2e5aa06026
commit 8cb42c39ad
26 changed files with 123 additions and 235 deletions

View File

@@ -80,8 +80,8 @@ func (c *commandVolumeCheckDisk) Do(args []string, commandEnv *CommandEnv, write
if *volumeId > 0 && replicas[0].info.Id != uint32(*volumeId) {
continue
}
slices.SortFunc(replicas, func(a, b *VolumeReplica) int {
return int(fileCount(b) - fileCount(a))
slices.SortFunc(replicas, func(a, b *VolumeReplica) bool {
return fileCount(a) > fileCount(b)
})
for len(replicas) >= 2 {
a, b := replicas[0], replicas[1]