-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
enhancementNew feature or requestNew feature or request
Description
The only method I can find is into_usizes which creates a new allocation.
I can manually accomplish this via iterating over all indices and using .filter(|i| matches!(bitset.get(i), Some(true)) but it seems like this is potentially not the most efficient implementation.
Would it be possible to add a method for this? Perhaps one that returns the iterator currently used internally in into_usizes?
v.storage
.into_iter()
.flat_map(|x| x.to_array())
.flat_map(|x| { (0..A::Item::ELEMENT_BIT_WIDTH).map(move |i| (x.wrapping_shr(i as u32)) & A::Item::ONE_ELEMENT != A::Item::ZERO_ELEMENT) })
.take(v.nbits)
.enumerate()
.filter(|(_, b)| *b)
.map(|(i, _)| i)Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request