[libcxx-commits] [pstl] r356891 - [pstl] Call the right overload of std::equal with an execution policy

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon Mar 25 05:37:51 PDT 2019


Author: ldionne
Date: Mon Mar 25 05:37:51 2019
New Revision: 356891

URL: http://llvm.org/viewvc/llvm-project?rev=356891&view=rev
Log:
[pstl] Call the right overload of std::equal with an execution policy

Thanks to Mikhail Dvorskiy for the patch.

Differential Revision: https://reviews.llvm.org/D59705

Modified:
    pstl/trunk/include/pstl/internal/glue_algorithm_impl.h

Modified: pstl/trunk/include/pstl/internal/glue_algorithm_impl.h
URL: http://llvm.org/viewvc/llvm-project/pstl/trunk/include/pstl/internal/glue_algorithm_impl.h?rev=356891&r1=356890&r2=356891&view=diff
==============================================================================
--- pstl/trunk/include/pstl/internal/glue_algorithm_impl.h (original)
+++ pstl/trunk/include/pstl/internal/glue_algorithm_impl.h Mon Mar 25 05:37:51 2019
@@ -736,11 +736,10 @@ __pstl::internal::enable_if_execution_po
 equal(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
       _ForwardIterator2 __last2, _BinaryPredicate __p)
 {
-    //TODO: to get rid of "distance"
     if (std::distance(__first1, __last1) == std::distance(__first2, __last2))
         return std::equal(__first1, __last1, __first2, __p);
-    else
-        return false;
+
+    return false;
 }
 
 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
@@ -748,7 +747,7 @@ __pstl::internal::enable_if_execution_po
 equal(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
       _ForwardIterator2 __last2)
 {
-    return equal(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __pstl::internal::pstl_equal());
+    return equal(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2, __pstl::internal::pstl_equal());
 }
 
 // [alg.move]




More information about the libcxx-commits mailing list