[libc-commits] [libc] [libc] Bound the worst-case stack usage in qsort(). (PR #110849)
via libc-commits
libc-commits at lists.llvm.org
Wed Oct 2 07:39:00 PDT 2024
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 f9fbfc587d793b25e5f3ea0c8fa1db949085b158 2a763fd6dea929b160d9f7f2048a3f3540de7214 --extensions h -- libc/src/stdlib/qsort_data.h libc/src/stdlib/quick_sort.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libc/src/stdlib/quick_sort.h b/libc/src/stdlib/quick_sort.h
index a3fe168159..db221943d9 100644
--- a/libc/src/stdlib/quick_sort.h
+++ b/libc/src/stdlib/quick_sort.h
@@ -79,10 +79,10 @@ LIBC_INLINE void quick_sort(Array array) {
// by log2 of the total array size, because every recursive call is sorting
// a list at most half the length of the one in its caller.
if (left.size() < right.size()) {
- quick_sort(left, depth+1);
+ quick_sort(left, depth + 1);
array.reset_bounds(right.get(0), right.size());
} else {
- quick_sort(right, depth+1);
+ quick_sort(right, depth + 1);
array.reset_bounds(left.get(0), left.size());
}
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/110849
More information about the libc-commits
mailing list