[libcxx-commits] [libcxx] [libc++] Optimize std::is_heap_until (PR #209141)
via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jul 13 04:21:07 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,cpp -- libcxx/include/__algorithm/is_heap_until.h libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/ranges_is_heap_until.pass.cpp --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/is_heap_until.h b/libcxx/include/__algorithm/is_heap_until.h
index cb5ea0373..725ca8aca 100644
--- a/libcxx/include/__algorithm/is_heap_until.h
+++ b/libcxx/include/__algorithm/is_heap_until.h
@@ -28,7 +28,7 @@ __is_heap_until(_Iter __first, _Iter __last, _Compare&& __comp) {
return __last;
auto __parent_last = __first + (__count - 1) / 2;
- auto __child = __first;
+ auto __child = __first;
++__child;
for (; __first != __parent_last; ++__first) {
if (__comp(*__first, *__child))
``````````
</details>
https://github.com/llvm/llvm-project/pull/209141
More information about the libcxx-commits
mailing list