mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
fix sort bug
This commit is contained in:
parent
469863f7f0
commit
ee3fe07acf
|
@ -151,14 +151,17 @@ func mergeIntoVisibles(visibles, newVisibles []*visibleInterval, chunk *filer_pb
|
||||||
}
|
}
|
||||||
newVisibles = append(newVisibles, newV)
|
newVisibles = append(newVisibles, newV)
|
||||||
|
|
||||||
for i := len(newVisibles) - 1; i > 0; i-- {
|
logPrintf(" append", newVisibles)
|
||||||
if newV.start < newVisibles[i-1].start {
|
|
||||||
|
for i := len(newVisibles) - 1; i >= 0; i-- {
|
||||||
|
if i > 0 && newV.start < newVisibles[i-1].start {
|
||||||
newVisibles[i] = newVisibles[i-1]
|
newVisibles[i] = newVisibles[i-1]
|
||||||
} else {
|
} else {
|
||||||
newVisibles[i] = newV
|
newVisibles[i] = newV
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
logPrintf(" sorted", newVisibles)
|
||||||
|
|
||||||
return newVisibles
|
return newVisibles
|
||||||
}
|
}
|
||||||
|
@ -175,9 +178,10 @@ func nonOverlappingVisibleIntervals(chunks []*filer_pb.FileChunk) (visibles []*v
|
||||||
t := visibles[:0]
|
t := visibles[:0]
|
||||||
visibles = newVislbles
|
visibles = newVislbles
|
||||||
newVislbles = t
|
newVislbles = t
|
||||||
}
|
|
||||||
|
|
||||||
logPrintf("visibles", visibles)
|
logPrintf("add", visibles)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue