[libcxx-commits] [PATCH] D59705: Hot fix for equal algo

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Mar 22 10:44:08 PDT 2019


ldionne requested changes to this revision.
ldionne added inline comments.
This revision now requires changes to proceed.


================
Comment at: include/pstl/internal/glue_algorithm_impl.h:739
 {
-    //TODO: to get rid of "distance"
-    if (std::distance(__first1, __last1) == std::distance(__first2, __last2))
+    if(std::distance(__first1, __last1) == std::distance(__first2, __last2))
         return std::equal(__first1, __last1, __first2, __p);
----------------
Please restore the space here.


================
Comment at: include/pstl/internal/glue_algorithm_impl.h:739
 {
-    //TODO: to get rid of "distance"
-    if (std::distance(__first1, __last1) == std::distance(__first2, __last2))
----------------
ldionne wrote:
> Please restore the space here.
Why are you removing the TODO?


================
Comment at: include/pstl/internal/glue_algorithm_impl.h:750
 {
-    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());
 }
----------------
What problem is this fixing? IIUC, before this patch, we would end up calling `equal(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2)` here and that would be a compiler error because `__pstl::internal::pstl_equal()` is not an iterator. Is that correct?

If so, this change should be accompanied by a test that goes through this code path.


Repository:
  rPSTL pstl

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59705/new/

https://reviews.llvm.org/D59705





More information about the libcxx-commits mailing list