firestorm valid docNum finding, fixes #310
This commit is contained in:
parent
7df07f94fa
commit
024848ac91
@ -45,9 +45,10 @@ type Snapshot struct {
|
|||||||
// if none, then 0
|
// if none, then 0
|
||||||
func (s *Snapshot) Which(docID []byte, docNumList DocNumberList) uint64 {
|
func (s *Snapshot) Which(docID []byte, docNumList DocNumberList) uint64 {
|
||||||
sort.Sort(docNumList)
|
sort.Sort(docNumList)
|
||||||
highestValidDocNum := docNumList.HighestValid(s.maxRead)
|
for _, docNum := range docNumList { // docNumList is sorted descending.
|
||||||
if highestValidDocNum > 0 && s.Valid(docID, highestValidDocNum) {
|
if docNum > 0 && s.Valid(docID, docNum) {
|
||||||
return highestValidDocNum
|
return docNum
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user