0
0
Fork 0

Merge pull request #756 from steveyen/optimize-storedIndexOffset-loop

scorch zap mergeStoredAndRemap loop optimization
This commit is contained in:
Steve Yen 2018-02-06 18:00:34 -08:00 committed by GitHub
commit 78a7ae562f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -506,17 +506,17 @@ func mergeStoredAndRemap(segments []*Segment, drops []*roaring.Bitmap,
}
// return value is the start of the stored index
offset := uint64(w.Count())
storedIndexOffset := uint64(w.Count())
// now write out the stored doc index
for docNum := range docNumOffsets {
err := binary.Write(w, binary.BigEndian, docNumOffsets[docNum])
for _, docNumOffset := range docNumOffsets {
err := binary.Write(w, binary.BigEndian, docNumOffset)
if err != nil {
return 0, nil, err
}
}
return offset, rv, nil
return storedIndexOffset, rv, nil
}
// mergeFields builds a unified list of fields used across all the input segments