status-go/vendor/github.com/RoaringBitmap/roaring/popcnt.go

12 lines
226 B
Go
Raw Permalink Normal View History

2022-03-10 09:44:48 +00:00
// +build go1.9
// "go1.9", from Go version 1.9 onward
// See https://golang.org/pkg/go/build/#hdr-Build_Constraints
package roaring
import "math/bits"
func popcount(x uint64) uint64 {
return uint64(bits.OnesCount64(x))
}