mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-23 08:06:11 +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:
@@ -60,7 +60,7 @@ struct Project::ProjectTreeNode : public RefCounted<ProjectTreeNode> {
|
||||
{
|
||||
if (type == Type::File)
|
||||
return;
|
||||
quick_sort(children.begin(), children.end(), [](auto& a, auto& b) {
|
||||
quick_sort(children, [](auto& a, auto& b) {
|
||||
return a->name < b->name;
|
||||
});
|
||||
for (auto& child : children)
|
||||
|
||||
Reference in New Issue
Block a user