Skip to main content

parallel_stream_compaction

Function parallel_stream_compaction 

Source
pub fn parallel_stream_compaction<T: Clone + Send + Sync>(
    data: &[T],
    pred: impl Fn(&T) -> bool + Sync,
) -> (Vec<T>, Vec<usize>)
Expand description

Parallel stream compaction via Rayon.

Each thread builds a local (value, original_index) list and then the lists are merged in order to preserve a deterministic output.