Minor fixes to some std::sort calls (#3967)

This commit is contained in:
Olxinos 2020-04-23 16:23:59 +01:00 committed by GitHub
parent 1976c4caed
commit db85ec48c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -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;