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 Feb 13, 2024
1 parent 22e9c5f commit e2dd6a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions croaring/src/treemap/iter.rs
Expand Up @@ -17,10 +17,11 @@ impl<'a> Iterator for To64Iter<'a> {
}
}

fn to64iter<'a>(t: (&'a u32, &'a Bitmap)) -> To64Iter<'a> {
fn to64iter<'a>((key, bitmap): (&'a u32, &'a Bitmap)) -> To64Iter<'a> {
assert!(!bitmap.is_empty(), "empty bitmap at {key}");
To64Iter {
key: *t.0,
iterator: t.1.iter(),
key: *key,
iterator: bitmap.iter(),
}
}

Expand Down
2 changes: 1 addition & 1 deletion fuzz/fuzz_targets/arbitrary_ops64/mod.rs
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 e2dd6a8

Please sign in to comment.