From bc72ac051962a41a254fef8c355b90b6bad08018 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Wed, 15 May 2024 16:21:00 +0200 Subject: [PATCH] wip --- lib/logstorage/bitmap.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/logstorage/bitmap.go b/lib/logstorage/bitmap.go index df72f7069..2c0ccd8f4 100644 --- a/lib/logstorage/bitmap.go +++ b/lib/logstorage/bitmap.go @@ -126,6 +126,7 @@ func (bm *bitmap) forEachSetBit(f func(idx int) bool) { if word == 0 { continue } + wordNew := word for j := 0; j < 64; j++ { mask := uint64(1) << j if (word & mask) == 0 { @@ -136,9 +137,12 @@ func (bm *bitmap) forEachSetBit(f func(idx int) bool) { break } if !f(idx) { - a[i] &= ^mask + wordNew &= ^mask } } + if word != wordNew { + a[i] = wordNew + } } }