diff options
author | Louis Dionne <ldionne@apple.com> | 2019-07-16 17:29:09 +0000 |
---|---|---|
committer | Louis Dionne <ldionne@apple.com> | 2019-07-16 17:29:09 +0000 |
commit | 3559fcd1149b339757b10365a4b24161b6ef71a5 (patch) | |
tree | 213469738a36906faa79069738360eaa03f21e09 /pstl | |
parent | c26e27d802c146d08446eab0d47e1dd2be233506 (diff) | |
download | llvm-3559fcd1149b339757b10365a4b24161b6ef71a5.tar.gz |
[pstl] Use std::transform_reduce instead of hand-rolled implementation
llvm-svn: 366233
Diffstat (limited to 'pstl')
-rw-r--r-- | pstl/include/pstl/internal/numeric_impl.h | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/pstl/include/pstl/internal/numeric_impl.h b/pstl/include/pstl/internal/numeric_impl.h index 625bb9441c8a..fe1f222d437e 100644 --- a/pstl/include/pstl/internal/numeric_impl.h +++ b/pstl/include/pstl/internal/numeric_impl.h @@ -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> |