mirror of
https://github.com/minio/minio.git
synced 2025-04-05 12:20:34 -04:00
heal: Fix new entries computation in listDirHeal (#3551)
A crash was happening due to an incorrect interpreation of the return value of sort.SearchString()
This commit is contained in:
parent
95d9e47353
commit
eb6d53d2f5
@ -58,7 +58,9 @@ func listDirHealFactory(isLeaf isLeafFunc, disks ...StorageAPI) listDirFunc {
|
|||||||
// find elements in entries which are not in mergedentries
|
// find elements in entries which are not in mergedentries
|
||||||
for _, entry := range entries {
|
for _, entry := range entries {
|
||||||
idx := sort.SearchStrings(mergedEntries, entry)
|
idx := sort.SearchStrings(mergedEntries, entry)
|
||||||
if mergedEntries[idx] == entry {
|
// idx different from len(mergedEntries) means entry is not found
|
||||||
|
// in mergedEntries
|
||||||
|
if idx < len(mergedEntries) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
newEntries = append(newEntries, entry)
|
newEntries = append(newEntries, entry)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user