This commit is contained in:
Aliaksandr Valialkin 2024-05-15 16:53:40 +02:00
parent 6026112913
commit 7ffcdabcbe
No known key found for this signature in database
GPG key ID: 52C003EE2BCDB9EB

View file

@ -148,6 +148,13 @@ func (bm *bitmap) forEachSetBit(f func(idx int) bool) {
// forEachSetBitReadonly calls f for each set bit
func (bm *bitmap) forEachSetBitReadonly(f func(idx int)) {
if bm.areAllBitsSet() {
for i := range bm.bitsLen {
f(i)
}
return
}
a := bm.a
bitsLen := bm.bitsLen
for i, word := range a {