remove branch and always count last container

This commit is contained in:
Matt Jaffee 2017-05-22 10:38:40 -05:00
parent 022d84e8aa
commit eae9d5c7f6

View file

@ -910,9 +910,8 @@ func (c *container) bitmapCountRange(start, end uint32) int {
// Count partial ending word.
if int(j) < len(c.bitmap) {
if off := 64 - (end % 64); off != 64 {
n += popcount(c.bitmap[j] << off)
}
off := 64 - (end % 64)
n += popcount(c.bitmap[j] << off)
}
return int(n)