mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-27 04:25:06 +08:00
Improve the RoaringBitmap codec to reserve enough vector space
This commit is contained in:
parent
3fe497e129
commit
816db7a0aa
@ -15,7 +15,7 @@ impl heed::BytesEncode<'_> for RoaringBitmapCodec {
|
|||||||
type EItem = RoaringBitmap;
|
type EItem = RoaringBitmap;
|
||||||
|
|
||||||
fn bytes_encode(item: &Self::EItem) -> Option<Cow<[u8]>> {
|
fn bytes_encode(item: &Self::EItem) -> Option<Cow<[u8]>> {
|
||||||
let mut bytes = Vec::new();
|
let mut bytes = Vec::with_capacity(item.serialized_size());
|
||||||
item.serialize_into(&mut bytes).ok()?;
|
item.serialize_into(&mut bytes).ok()?;
|
||||||
Some(Cow::Owned(bytes))
|
Some(Cow::Owned(bytes))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user