From a990de90fe41456a23e58bd087d2f107d321f3a1 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Fri, 19 Jul 2024 16:37:58 +0400 Subject: Deleted vendor folder --- vendor/rayon/src/iter/reduce.rs | 116 ---------------------------------------- 1 file changed, 116 deletions(-) delete mode 100644 vendor/rayon/src/iter/reduce.rs (limited to 'vendor/rayon/src/iter/reduce.rs') diff --git a/vendor/rayon/src/iter/reduce.rs b/vendor/rayon/src/iter/reduce.rs deleted file mode 100644 index 321b5dd..0000000 --- a/vendor/rayon/src/iter/reduce.rs +++ /dev/null @@ -1,116 +0,0 @@ -use super::plumbing::*; -use super::ParallelIterator; - -pub(super) fn reduce(pi: PI, identity: ID, reduce_op: R) -> T -where - PI: ParallelIterator, - R: Fn(T, T) -> T + Sync, - ID: Fn() -> T + Sync, - T: Send, -{ - let consumer = ReduceConsumer { - identity: &identity, - reduce_op: &reduce_op, - }; - pi.drive_unindexed(consumer) -} - -struct ReduceConsumer<'r, R, ID> { - identity: &'r ID, - reduce_op: &'r R, -} - -impl<'r, R, ID> Copy for ReduceConsumer<'r, R, ID> {} - -impl<'r, R, ID> Clone for ReduceConsumer<'r, R, ID> { - fn clone(&self) -> Self { - *self - } -} - -impl<'r, R, ID, T> Consumer for ReduceConsumer<'r, R, ID> -where - R: Fn(T, T) -> T + Sync, - ID: Fn() -> T + Sync, - T: Send, -{ - type Folder = ReduceFolder<'r, R, T>; - type Reducer = Self; - type Result = T; - - fn split_at(self, _index: usize) -> (Self, Self, Self) { - (self, self, self) - } - - fn into_folder(self) -> Self::Folder { - ReduceFolder { - reduce_op: self.reduce_op, - item: (self.identity)(), - } - } - - fn full(&self) -> bool { - false - } -} - -impl<'r, R, ID, T> UnindexedConsumer for ReduceConsumer<'r, R, ID> -where - R: Fn(T, T) -> T + Sync, - ID: Fn() -> T + Sync, - T: Send, -{ - fn split_off_left(&self) -> Self { - *self - } - - fn to_reducer(&self) -> Self::Reducer { - *self - } -} - -impl<'r, R, ID, T> Reducer for ReduceConsumer<'r, R, ID> -where - R: Fn(T, T) -> T + Sync, -{ - fn reduce(self, left: T, right: T) -> T { - (self.reduce_op)(left, right) - } -} - -struct ReduceFolder<'r, R, T> { - reduce_op: &'r R, - item: T, -} - -impl<'r, R, T> Folder for ReduceFolder<'r, R, T> -where - R: Fn(T, T) -> T, -{ - type Result = T; - - fn consume(self, item: T) -> Self { - ReduceFolder { - reduce_op: self.reduce_op, - item: (self.reduce_op)(self.item, item), - } - } - - fn consume_iter(self, iter: I) -> Self - where - I: IntoIterator, - { - ReduceFolder { - reduce_op: self.reduce_op, - item: iter.into_iter().fold(self.item, self.reduce_op), - } - } - - fn complete(self) -> T { - self.item - } - - fn full(&self) -> bool { - false - } -} -- cgit v1.2.3