[libc-commits] [libc] [llvm] [libc] Improve qsort (PR #120450)

Orson Peters via libc-commits libc-commits at lists.llvm.org
Wed Dec 18 23:43:54 PST 2024


================
@@ -27,11 +27,46 @@
 namespace LIBC_NAMESPACE_DECL {
 namespace internal {
 
+template <typename A, typename F> void sort_inst(A &array, const F &is_less) {
----------------
orlp wrote:

@michaelrj-google I do believe it returns a boolean, see [`libc/src/stdlib/qsort.cpp`](https://github.com/llvm/llvm-project/pull/120450/files/efb98579a7f56c721402d526086fa24a9cbc3110#diff-26ff238bd5dfa4e151c74fb30555d8b07621bbf887766762dbf4774f1c9f5c2f) where `internal::quicksort` is instantiated with `compare(a, b) < 0`.

https://github.com/llvm/llvm-project/pull/120450


More information about the libc-commits mailing list