remove branch and always count last container

This commit is contained in:
Matt Jaffee 2017-05-22 10:38:40 -05:00
parent 6b3b459659
commit e90e1455db

View file

@ -924,9 +924,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)