MCPcopy Index your code
hub / github.com/RoaringBitmap/roaring / fillArrayXOR

Function fillArrayXOR

util.go:97–112  ·  view source on GitHub ↗
(container []uint16, bitmap1, bitmap2 []uint64)

Source from the content-addressed store, hash-verified

95}
96
97func fillArrayXOR(container []uint16, bitmap1, bitmap2 []uint64) {
98 if len(bitmap1) != len(bitmap2) {
99 panic("array lengths don't match")
100 }
101 // TODO: rewrite in assembly
102 pos := 0
103 for k := 0; k < len(bitmap1); k++ {
104 bitset := bitmap1[k] ^ bitmap2[k]
105 for bitset != 0 {
106 t := bitset & -bitset
107 container[pos] = uint16((k*64 + int(popcount(t-1))))
108 pos = pos + 1
109 bitset ^= t
110 }
111 }
112}
113
114func highbits(x uint32) uint16 {
115 return uint16(x >> 16)

Callers 2

xorBitmapMethod · 0.85
ixorBitmapMethod · 0.85

Calls 1

popcountFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…