mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:37:36 +00:00
AK: Make quick_sort() a little more ergonomic
Now it actually defaults to "a < b" comparison, instead of forcing you to provide a trivial less-than comparator. Also you can pass in any collection type that has .begin() and .end() and we'll sort it for you.
This commit is contained in:
parent
058cd1241e
commit
686ade6b5a
14 changed files with 35 additions and 23 deletions
|
@ -184,7 +184,7 @@ int main(int, char**)
|
|||
threads.append(&it.value);
|
||||
}
|
||||
|
||||
quick_sort(threads.begin(), threads.end(), [](auto* p1, auto* p2) {
|
||||
quick_sort(threads, [](auto* p1, auto* p2) {
|
||||
return p2->times_scheduled_since_prev < p1->times_scheduled_since_prev;
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue