mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-02-04 19:11:38 -08:00
Minor fixes to some std::sort calls (#3967)
This commit is contained in:
@@ -364,7 +364,7 @@ void WndSets::actDown()
|
||||
{
|
||||
QModelIndexList rows = view->selectionModel()->selectedRows();
|
||||
// QModelIndex only implements operator<, so we can't use std::greater
|
||||
std::sort(rows.begin(), rows.end(), [](const QModelIndex &a, const QModelIndex &b) { return !(b < a); });
|
||||
std::sort(rows.begin(), rows.end(), [](const QModelIndex &a, const QModelIndex &b) { return b < a; });
|
||||
QSet<int> newRows;
|
||||
|
||||
if (rows.empty())
|
||||
@@ -412,7 +412,7 @@ void WndSets::actBottom()
|
||||
{
|
||||
QModelIndexList rows = view->selectionModel()->selectedRows();
|
||||
// QModelIndex only implements operator<, so we can't use std::greater
|
||||
std::sort(rows.begin(), rows.end(), [](const QModelIndex &a, const QModelIndex &b) { return !(b < a); });
|
||||
std::sort(rows.begin(), rows.end(), [](const QModelIndex &a, const QModelIndex &b) { return b < a; });
|
||||
QSet<int> newRows;
|
||||
int newRow = model->rowCount() - 1;
|
||||
|
||||
|
||||
@@ -254,7 +254,7 @@ public:
|
||||
}
|
||||
inline bool operator()(QPair<int, AbstractDecklistNode *> a, QPair<int, AbstractDecklistNode *> b) const
|
||||
{
|
||||
return (order == Qt::AscendingOrder) ^ (a.second->compare(b.second));
|
||||
return (order == Qt::AscendingOrder) ? (b.second->compare(a.second)) : (a.second->compare(b.second));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user