mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-01 06:07:59 +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:
@@ -401,7 +401,7 @@ bool Scheduler::pick_next()
|
||||
sorted_runnables.append(&thread);
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
quick_sort(sorted_runnables.begin(), sorted_runnables.end(), [](auto& a, auto& b) { return a->effective_priority() >= b->effective_priority(); });
|
||||
quick_sort(sorted_runnables, [](auto& a, auto& b) { return a->effective_priority() >= b->effective_priority(); });
|
||||
|
||||
Thread* thread_to_schedule = nullptr;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user