rank cache update after count

This commit is contained in:
Todd Gruben 2017-02-27 12:42:36 -06:00 committed by Travis
parent 144d64c250
commit 29ccab9624

View file

@ -398,9 +398,10 @@ func (f *Fragment) setBit(bitmapID, profileID uint64) (changed bool, bool error)
}
// Update the cache.
if f.bitmap(bitmapID, true).SetBit(profileID) {
changed = true
}
bm := f.bitmap(bitmapID, true)
bm.SetBit(profileID)
bm.InvalidateCount() //maybe a perf opportunity?
f.cache.Add(bitmapID, bm.Count())
f.stats.Count("setN", 1)
@ -442,9 +443,10 @@ func (f *Fragment) clearBit(bitmapID, profileID uint64) (bool, error) {
}
// Update the cache.
if f.bitmap(bitmapID, true).ClearBit(profileID) {
return true, nil
}
bm := f.bitmap(bitmapID, true)
bm.ClearBit(profileID)
bm.InvalidateCount() //maybe a perf opportunity?
f.cache.Add(bitmapID, bm.Count())
f.stats.Count("clearN", 1)