Skip to content

Commit

Permalink
feat: retain
Browse files Browse the repository at this point in the history
  • Loading branch information
JakkuSakura committed May 22, 2024
1 parent d18cf89 commit cf4f212
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/worktable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,11 @@ impl WorkTable {
phantom: std::marker::PhantomData,
}
}
pub fn retain(&mut self, f: impl Fn(&RowViewMut) -> bool) {
self.iter_mut().filter(f).for_each(|row| {
row.remove();
});
}
}

pub type SyncWorkTable = Arc<RwLock<WorkTable>>;
Expand Down

0 comments on commit cf4f212

Please sign in to comment.