Skip to content

Commit

Permalink
AddMany instead of Add to a bitmap
Browse files Browse the repository at this point in the history
  • Loading branch information
metonymic-smokey committed Oct 15, 2024
1 parent 3c77b49 commit 7404155
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions index/scorch/snapshot_index_vr.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,16 @@ type IndexSnapshotVectorReader struct {
// (AND) operations. Eg. finding the eligible doc IDs present in a segment.
func (i *IndexSnapshotVectorReader) getEligibleDocIDs() *roaring.Bitmap {
res := roaring.NewBitmap()
internalDocIDs := make([]uint32, 0, len(i.eligibleDocIDs))
// converts the doc IDs to uint32 and returns
for _, eligibleDocInternalID := range i.eligibleDocIDs {
internalDocID, _ := docInternalToNumber(index.IndexInternalID(eligibleDocInternalID))
res.Add(uint32(internalDocID))
internalDocID, err := docInternalToNumber(index.IndexInternalID(eligibleDocInternalID))
if err != nil {
continue
}
internalDocIDs = append(internalDocIDs, uint32(internalDocID))
}
res.AddMany(internalDocIDs)
return res
}

Expand Down

0 comments on commit 7404155

Please sign in to comment.