[libcxx-commits] [libcxx] [libc++] [sort] Improve performance of std::sort (PR #76616)

Daniel Kutenin via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jan 16 05:01:35 PST 2024


================
@@ -68,8 +68,7 @@ void test_same() {
   auto snapshot_custom_v = v;
   std::sort(v.begin(), v.end());
   std::sort(snapshot_v.begin(), snapshot_v.end());
-  std::sort(snapshot_custom_v.begin(), snapshot_custom_v.end(),
-            [](const EqualType&, const EqualType&) { return false; });
----------------
danlark1 wrote:

Also, I still don't understand why we need to change the comparator here. The test checks that randomization happens for any sort you call

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


More information about the libcxx-commits mailing list