mirror of
				https://github.com/meilisearch/meilisearch.git
				synced 2025-10-31 07:56:28 +00:00 
			
		
		
		
	Call the serialize_into_writer method from the serialize_into one
This commit is contained in:
		| @@ -27,18 +27,8 @@ impl CboRoaringBitmapCodec { | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     pub fn serialize_into(roaring: &RoaringBitmap, vec: &mut Vec<u8>) { | ||||
|         if roaring.len() <= THRESHOLD as u64 { | ||||
|             // If the number of items (u32s) to encode is less than or equal to the threshold | ||||
|             // it means that it would weigh the same or less than the RoaringBitmap | ||||
|             // header, so we directly encode them using ByteOrder instead. | ||||
|             for integer in roaring { | ||||
|                 vec.write_u32::<NativeEndian>(integer).unwrap(); | ||||
|             } | ||||
|         } else { | ||||
|             // Otherwise, we use the classic RoaringBitmapCodec that writes a header. | ||||
|             roaring.serialize_into(vec).unwrap(); | ||||
|         } | ||||
|     pub fn serialize_into_vec(roaring: &RoaringBitmap, vec: &mut Vec<u8>) { | ||||
|         Self::serialize_into_writer(roaring, vec).unwrap() | ||||
|     } | ||||
|  | ||||
|     pub fn serialize_into_writer<W: io::Write>( | ||||
|   | ||||
		Reference in New Issue
	
	Block a user