lib/mergeset: properly check for sorted block headers

Fix a typo for https://github.com/VictoriaMetrics/VictoriaMetrics/issues/181
This commit is contained in:
Aliaksandr Valialkin 2019-09-13 21:58:26 +03:00
parent d4218d27e6
commit 0c8057924f

View file

@ -158,7 +158,7 @@ func unmarshalBlockHeaders(dst []blockHeader, src []byte, blockHeadersCount int)
newBHS := dst[dstLen:]
// Verify that block headers are sorted by firstItem.
if !sort.SliceIsSorted(newBHS, func(i, j int) bool { return string(newBHS[i].firstItem) <= string(newBHS[j].firstItem) }) {
if !sort.SliceIsSorted(newBHS, func(i, j int) bool { return string(newBHS[i].firstItem) < string(newBHS[j].firstItem) }) {
return nil, fmt.Errorf("block headers must be sorted by firstItem; unmarshaled unsorted block headers: %#v", newBHS)
}