Skip to content

Commit a2a574b

Browse files
committed
Fix Bitmap32's Range() method
1 parent 632259d commit a2a574b

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

bitmap_32.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func (b *Bitmap32) Range(f func(n uint32) bool) {
9090
for i, block := range *b {
9191
for block != 0 {
9292
tz := bits.TrailingZeros32(block)
93-
bitIndex := uint32(i*64 + tz)
93+
bitIndex := uint32(i*32 + tz)
9494

9595
if !f(bitIndex) {
9696
return

bitmap_32_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ func Test_Bitmap32_Range(t *testing.T) {
167167
return true
168168
})
169169

170-
assert.Equal(t, []uint32{0, 1, 2, 1992, 19984}, items)
170+
assert.Equal(t, []uint32{0, 1, 2, 1000}, items)
171171
}
172172

173173
func Benchmark_Bitmap32_String(b *testing.B) {

0 commit comments

Comments
 (0)