1
Fork 0

Fix sparse intersect bug, add more sparse / dense tests

This commit is contained in:
Will Crichton 2021-08-26 11:39:13 -07:00
parent 1c1603e0b5
commit d73a169f93
2 changed files with 13 additions and 2 deletions

View file

@ -272,7 +272,7 @@ fn dense_sparse_intersect<T: Idx>(
sparse: &SparseBitSet<T>,
) -> (SparseBitSet<T>, bool) {
let mut sparse_copy = sparse.clone();
sparse_intersect(&mut sparse_copy, |el| !dense.contains(*el));
sparse_intersect(&mut sparse_copy, |el| dense.contains(*el));
let n = sparse_copy.len();
(sparse_copy, n != dense.count())
}