Merge branch 'main' of https://cnb.cool/blzing/blazing
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
昔念
2026-02-19 23:59:33 +08:00
3 changed files with 28 additions and 15 deletions

View File

@@ -3,6 +3,13 @@ package bitset32
import "math/bits"
func popcntSlice(s []uint32) uint64 {
// int r = 0;
// while(n)
// {
// n &= (n - 1);
// ++r;
// }
var cnt int
for _, x := range s {
cnt += bits.OnesCount32(x)