From 2d1a330a028fff7836fb4ab4d6253c7c00df4545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Mon, 25 Nov 2024 10:20:15 +0100 Subject: [PATCH] Make sure not to overflow values in the the Statistics --- roaring/src/bitmap/statistics.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roaring/src/bitmap/statistics.rs b/roaring/src/bitmap/statistics.rs index e39b904a..d3aea382 100644 --- a/roaring/src/bitmap/statistics.rs +++ b/roaring/src/bitmap/statistics.rs @@ -22,7 +22,7 @@ pub struct Statistics { /// Number of values stored in run containers pub n_values_run_containers: u32, /// Number of values stored in bitset containers - pub n_values_bitset_containers: u32, + pub n_values_bitset_containers: u64, /// Number of bytes used by array containers pub n_bytes_array_containers: u64, /// Number of bytes used by run containers @@ -80,7 +80,7 @@ impl RoaringBitmap { } Store::Bitmap(bitmap) => { cardinality += bitmap.len(); - n_values_bitset_containers += bitmap.len() as u32; + n_values_bitset_containers += bitmap.len(); n_bytes_bitset_containers += bitmap.capacity() as u64; n_bitset_containers += 1; }