0
0
Fork 0

scorch zap merge optimize newDocNums lookup to outside of loop

And, also a "go fmt".
This commit is contained in:
Steve Yen 2018-02-26 14:23:53 -08:00
parent 98d5d7bd81
commit 99ed127176
4 changed files with 8 additions and 7 deletions

View File

@ -68,7 +68,6 @@ OUTER:
persistWatchers = s.pausePersisterForMergerCatchUp(lastPersistedEpoch,
&lastMergedEpoch, persistWatchers)
var ourSnapshot *IndexSnapshot
var ourPersisted []chan error

View File

@ -316,10 +316,12 @@ func persistMergedRest(segments []*SegmentBase, dropsIn []*roaring.Bitmap,
return nil, 0, err2
}
newDocNumsI := newDocNums[itrI]
postItr = postings.iterator(postItr)
next, err2 := postItr.Next()
for next != nil && err2 == nil {
hitNewDocNum := newDocNums[itrI][next.Number()]
hitNewDocNum := newDocNumsI[next.Number()]
if hitNewDocNum == docDropped {
return nil, 0, fmt.Errorf("see hit with dropped doc num")
}