Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion roaring/src/treemap/inherent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,8 @@ impl RoaringTreemap {
/// assert!(rb.is_full());
/// ```
pub fn is_full(&self) -> bool {
self.map.len() == (u32::MAX as usize + 1) && self.map.values().all(RoaringBitmap::is_full)
self.map.len() == (u32::MAX as u64 + 1) as usize
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this testing that length is zero on a 32 bit machine?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I really didn't think of this.

Using the len method on a 32-bit machine to test if a RoaringTreemap is full will never work due to the signature of len.
Atleast calling is_full doesn't panic in debug builds now, but this is not a proper fix.

&& self.map.values().all(RoaringBitmap::is_full)
}

/// Returns the number of distinct integers added to the set.
Expand Down