This commit is contained in:
Todd Gruben 2017-08-15 11:36:49 -05:00
parent 5a0eea2948
commit 7bcbfaef09

View file

@ -197,6 +197,7 @@ func (b *Bitmap) CountRange(start, end uint64) (n uint64) {
if len(b.keys) == 0 {
return
}
skey := highbits(start)
ekey := highbits(end)
@ -233,7 +234,11 @@ func (b *Bitmap) CountRange(start, end uint64) (n uint64) {
// Count containers in between.
for x := i + 1; x < j; x++ {
if ekey < b.keys[x] {
break
}
n += uint64(b.containers[x].n)
}
return n