Skip to content

Commit 3559fcd

Browse files
committed
[pstl] Use std::transform_reduce instead of hand-rolled implementation
llvm-svn: 366233
1 parent c26e27d commit 3559fcd

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

pstl/include/pstl/internal/numeric_impl.h

+1-5
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,7 @@ _Tp
9393
__brick_transform_reduce(_ForwardIterator __first, _ForwardIterator __last, _Tp __init, _BinaryOperation __binary_op,
9494
_UnaryOperation __unary_op, /*is_vector=*/std::false_type) noexcept
9595
{
96-
for (; __first != __last; ++__first)
97-
{
98-
__init = __binary_op(__init, __unary_op(*__first));
99-
}
100-
return __init;
96+
return std::transform_reduce(__first, __last, __init, __binary_op, __unary_op);
10197
}
10298

10399
template <class _ForwardIterator, class _Tp, class _UnaryOperation, class _BinaryOperation>

0 commit comments

Comments
 (0)