improve bit_set
assertion
it missed the index and bounds info
This commit is contained in:
parent
1bea7f9a44
commit
cbdac2f0e9
1 changed files with 6 additions and 1 deletions
|
@ -179,7 +179,12 @@ impl<T: Idx> BitSet<T> {
|
||||||
/// Insert `elem`. Returns whether the set has changed.
|
/// Insert `elem`. Returns whether the set has changed.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn insert(&mut self, elem: T) -> bool {
|
pub fn insert(&mut self, elem: T) -> bool {
|
||||||
assert!(elem.index() < self.domain_size);
|
assert!(
|
||||||
|
elem.index() < self.domain_size,
|
||||||
|
"inserting element at index {} but domain size is {}",
|
||||||
|
elem.index(),
|
||||||
|
self.domain_size,
|
||||||
|
);
|
||||||
let (word_index, mask) = word_index_and_mask(elem);
|
let (word_index, mask) = word_index_and_mask(elem);
|
||||||
let word_ref = &mut self.words[word_index];
|
let word_ref = &mut self.words[word_index];
|
||||||
let word = *word_ref;
|
let word = *word_ref;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue