[pstl] Use std::transform_reduce instead of hand-rolled implementation

llvm-svn: 366233
This commit is contained in:
Louis Dionne 2019-07-16 17:29:09 +00:00
parent c26e27d802
commit 3559fcd114

View File

@ -93,11 +93,7 @@ _Tp
__brick_transform_reduce(_ForwardIterator __first, _ForwardIterator __last, _Tp __init, _BinaryOperation __binary_op,
_UnaryOperation __unary_op, /*is_vector=*/std::false_type) noexcept
{
for (; __first != __last; ++__first)
{
__init = __binary_op(__init, __unary_op(*__first));
}
return __init;
return std::transform_reduce(__first, __last, __init, __binary_op, __unary_op);
}
template <class _ForwardIterator, class _Tp, class _UnaryOperation, class _BinaryOperation>