Skip to content

Commit

Permalink
Try to find empty subbitmaps in treemap
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr-Emann committed Jan 28, 2024
1 parent 1dae104 commit a236172
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion croaring/src/treemap/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ pub struct TreemapIterator<'a> {

impl<'a> TreemapIterator<'a> {
fn new(treemap: &'a Treemap) -> Self {
let iter = treemap.map.iter().flat_map(to64iter as _);
let iter = treemap
.map
.iter()
.inspect(|(key, bitmap)| assert!(!bitmap.is_empty(), "empty bitmap at {key}"))
.flat_map(to64iter as _);

TreemapIterator { iter }

Check failure on line 48 in croaring/src/treemap/iter.rs

View workflow job for this annotation

GitHub Actions / Test on ubuntu-latest using Rust stable with bindgen features ''

mismatched types

Check failure on line 48 in croaring/src/treemap/iter.rs

View workflow job for this annotation

GitHub Actions / Test on ubuntu-latest using Rust nightly with bindgen features ''

mismatched types

Check failure on line 48 in croaring/src/treemap/iter.rs

View workflow job for this annotation

GitHub Actions / Test on macos-latest using Rust stable with bindgen features ''

mismatched types
}
Expand Down
2 changes: 1 addition & 1 deletion fuzz/fuzz_targets/arbitrary_ops64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ pub fn assert_64_eq(lhs: &Bitmap64, rhs: &Treemap) {
let r = rhs.next().unwrap();
assert_eq!(l, r, "{l} != {r} at {i}");
}
assert!(rhs.next().is_none());
assert_eq!(rhs.next(), None);
panic!("Serialize not equal, but all items equal?")
}
}

0 comments on commit a236172

Please sign in to comment.