We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6c9a9d9 commit 95937e6Copy full SHA for 95937e6
libcxx/include/__algorithm/find_first_of.h
@@ -26,11 +26,9 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _ForwardIterator1 __find_fir
26
_ForwardIterator2 __first2,
27
_ForwardIterator2 __last2,
28
_BinaryPredicate&& __pred) {
29
- for (; __first1 != __last1; ++__first1)
30
- for (_ForwardIterator2 __j = __first2; __j != __last2; ++__j)
31
- if (__pred(*__first1, *__j))
32
- return __first1;
33
- return __last1;
+ return std::find_if(first1, last1, [&](const auto& x) {
+ return std::any_of(first2, last2, [&](const auto& y) { return x == y; });
+ });
34
}
35
36
template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
0 commit comments