Slicing for traces, both normal and positive

This commit is contained in:
elvis
2025-09-24 18:25:56 +02:00
parent eee0439f6e
commit fac85a10d5
10 changed files with 1028 additions and 61 deletions

View File

@ -636,6 +636,13 @@ impl PositiveSet {
ret
}
/// Returns all elements that are present in self and are positive in other.
pub fn mask(&self, other: &Self) -> Self {
Self::from_iter(self.iter().filter(|el| {
other.contains(&PositiveType::from((*el.0, IdState::Positive)))
}).map(|el| (*el.0, *el.1)))
}
fn remove_elements(&mut self, other: Vec<IdType>) {
for element in other {
self.identifiers.remove(&element);