diff --git a/milli/src/heed_codec/roaring_bitmap/cbo_roaring_bitmap_codec.rs b/milli/src/heed_codec/roaring_bitmap/cbo_roaring_bitmap_codec.rs index 4c40ac7b1..ef37ddc8b 100644 --- a/milli/src/heed_codec/roaring_bitmap/cbo_roaring_bitmap_codec.rs +++ b/milli/src/heed_codec/roaring_bitmap/cbo_roaring_bitmap_codec.rs @@ -71,6 +71,7 @@ impl CboRoaringBitmapCodec { for bytes in slices { if bytes.len() <= THRESHOLD * size_of::() { debug_assert!(bytes.len() % size_of::() == 0); + vec.reserve(bytes.len() / size_of::()); for bytes in bytes.chunks_exact(size_of::()) { // unwrap can't happens since we ensured that everything