From 7ffcdabcbec35401462bc97d458ac7e7d5de78ee Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Wed, 15 May 2024 16:53:40 +0200 Subject: [PATCH] wip --- lib/logstorage/bitmap.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/logstorage/bitmap.go b/lib/logstorage/bitmap.go index c71efe8b9..ad35f4e46 100644 --- a/lib/logstorage/bitmap.go +++ b/lib/logstorage/bitmap.go @@ -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 {