From b71031c1463c2bec1984316ea5f5173a9e09c028 Mon Sep 17 00:00:00 2001 From: Jakub Doka Date: Tue, 12 Nov 2024 21:12:57 +0100 Subject: [PATCH] prolly fix --- lang/src/utils.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/src/utils.rs b/lang/src/utils.rs index f22ee476..86098942 100644 --- a/lang/src/utils.rs +++ b/lang/src/utils.rs @@ -125,7 +125,7 @@ impl BitSet { let index = index as usize; let (mut data, len) = self.data_mut_and_len(); if core::intrinsics::unlikely(index >= len) { - self.grow(index.next_power_of_two().max(4 * Self::UNIT)); + self.grow((index + 1).next_power_of_two().max(4 * Self::UNIT)); (data, _) = self.data_mut_and_len(); }