summaryrefslogtreecommitdiff
path: root/libcxx/src/algorithm.cpp
diff options
context:
space:
mode:
authorNikolas Klauser <nikolasklauser@berlin.de>2024-08-27 16:54:05 +0200
committerGitHub <noreply@github.com>2024-08-27 16:54:05 +0200
commitd4ffccfce103b01401b8a9222e373f2d404f8439 (patch)
treefb79ead2c382c470936e889cc15847a803d84049 /libcxx/src/algorithm.cpp
parente8863748ba76462cdbfdcbd7bd99cadf392c01f4 (diff)
[libc++] Simplify the implementation of std::sort a bit (#104902)
This does a few things to canonicalize the library a bit. Specifically - use `__desugars_to_v` instead of the custom `__is_simple_comparator` - make `__use_branchless_sort` an inline variable - remove the `_maybe_branchless` versions of the `__sortN` functions and overload based on whether we can do branchless sorting instead.
Diffstat (limited to 'libcxx/src/algorithm.cpp')
-rw-r--r--libcxx/src/algorithm.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/libcxx/src/algorithm.cpp b/libcxx/src/algorithm.cpp
index af9d60a8e271..a7c39b5e5183 100644
--- a/libcxx/src/algorithm.cpp
+++ b/libcxx/src/algorithm.cpp
@@ -21,8 +21,7 @@ void __sort(RandomAccessIterator first, RandomAccessIterator last, Comp comp) {
std::__introsort<_ClassicAlgPolicy,
ranges::less,
RandomAccessIterator,
- __use_branchless_sort<ranges::less, RandomAccessIterator>::value>(
- first, last, ranges::less{}, depth_limit);
+ __use_branchless_sort<ranges::less, RandomAccessIterator>>(first, last, ranges::less{}, depth_limit);
}
// clang-format off