mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-20 06:36:16 +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:
@@ -121,7 +121,7 @@ void SortingProxyModel::resort()
|
||||
did_update();
|
||||
return;
|
||||
}
|
||||
quick_sort(m_row_mappings.begin(), m_row_mappings.end(), [&](auto row1, auto row2) -> bool {
|
||||
quick_sort(m_row_mappings, [&](auto row1, auto row2) -> bool {
|
||||
auto data1 = target().data(target().index(row1, m_key_column), Model::Role::Sort);
|
||||
auto data2 = target().data(target().index(row2, m_key_column), Model::Role::Sort);
|
||||
if (data1 == data2)
|
||||
|
||||
Reference in New Issue
Block a user