[libcxx-commits] [libcxx] [libc++] Add `__find_end` optimizations back (PR #171374)
via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Dec 9 02:39:36 PST 2025
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/find_end.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/find_end.h b/libcxx/include/__algorithm/find_end.h
index 61b7a6f07..84b43e31a 100644
--- a/libcxx/include/__algorithm/find_end.h
+++ b/libcxx/include/__algorithm/find_end.h
@@ -112,8 +112,8 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_Iter1, _Iter1> __find_
}
// *__l1 matches *__l2, now match elements before here
_Iter1 __match_last = __l1;
- _Iter1 __m1 = __l1;
- _Iter2 __m2 = __l2;
+ _Iter1 __m1 = __l1;
+ _Iter2 __m2 = __l2;
while (true) {
if (__m2 == __first2) // If pattern exhausted, __m1 is the answer (works for 1 element pattern)
return std::make_pair(__m1, ++__match_last);
``````````
</details>
https://github.com/llvm/llvm-project/pull/171374
More information about the libcxx-commits
mailing list