[libcxx-commits] [libcxx] [libc++] Refactor __search_forward_impl to use __mismatch (PR #192785)
via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Apr 18 03:50:37 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions h -- libcxx/include/__algorithm/search.h --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libcxx/include/__algorithm/search.h b/libcxx/include/__algorithm/search.h
index 33b7a6218..5219e7208 100644
--- a/libcxx/include/__algorithm/search.h
+++ b/libcxx/include/__algorithm/search.h
@@ -39,7 +39,6 @@ template <class _AlgPolicy,
class _Proj2>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_Iter1, _Iter1> __search_forward_impl(
_Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 __last2, _Pred& __pred, _Proj1& __proj1, _Proj2& __proj2) {
-
if (__first2 == __last2)
return std::make_pair(__first1, __first1); // Everything matches an empty sequence
``````````
</details>
https://github.com/llvm/llvm-project/pull/192785
More information about the libcxx-commits
mailing list