mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-09 22:51:02 +00:00
fix comment, remove unneeded step
It turns out NewSliceBitmap can take an initial set of values already.
This commit is contained in:
parent
4ddbadcea7
commit
cc5e822799
1 changed files with 5 additions and 8 deletions
13
fragment.go
13
fragment.go
|
|
@ -2525,7 +2525,7 @@ func sliceDifference(original, remove []uint64) []uint64 {
|
|||
n++
|
||||
}
|
||||
}
|
||||
return append(original[:n], original[on+1:]...)
|
||||
return original[:n]
|
||||
}
|
||||
|
||||
// bulkImportMutex performs a bulk import on a fragment while ensuring
|
||||
|
|
@ -2541,12 +2541,9 @@ func (f *fragment) bulkImportMutex(tx Tx, rowIDs, columnIDs []uint64) error {
|
|||
columnIDs = p.cols
|
||||
rowIDs = p.rows
|
||||
|
||||
// create a mask of rows we care about
|
||||
columns := roaring.NewSliceBitmap()
|
||||
_, err := columns.AddN(columnIDs...)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "creating bitmap of affected columns")
|
||||
}
|
||||
// create a mask of columns we care about
|
||||
columns := roaring.NewSliceBitmap(columnIDs...)
|
||||
|
||||
// we now need to find existing rows for these bits.
|
||||
rowSet := make(map[uint64]struct{}, len(rowIDs))
|
||||
unsorted := false
|
||||
|
|
@ -2579,7 +2576,7 @@ func (f *fragment) bulkImportMutex(tx Tx, rowIDs, columnIDs []uint64) error {
|
|||
return nil
|
||||
}
|
||||
findExisting := roaring.NewBitmapBitmapFilter(columns, callback)
|
||||
err = tx.ApplyFilter(f.index(), f.field(), f.view(), f.shard, 0, findExisting)
|
||||
err := tx.ApplyFilter(f.index(), f.field(), f.view(), f.shard, 0, findExisting)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "finding existing positions")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue