Skip to content

Commit 59373e3

Browse files
committed
refactor: replace qSort with std::sort
1 parent fea33cb commit 59373e3

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/qt/addresstablemodel.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#include <key_io.h>
1111
#include <wallet/wallet.h>
1212

13+
#include <algorithm>
14+
1315
#include <QFont>
1416
#include <QDebug>
1517

@@ -89,7 +91,7 @@ class AddressTablePriv
8991
// qLowerBound() and qUpperBound() require our cachedAddressTable list to be sorted in asc order
9092
// Even though the map is already sorted this re-sorting step is needed because the originating map
9193
// is sorted by binary address, not by base58() address.
92-
qSort(cachedAddressTable.begin(), cachedAddressTable.end(), AddressTableEntryLessThan());
94+
std::sort(cachedAddressTable.begin(), cachedAddressTable.end(), AddressTableEntryLessThan());
9395
}
9496

9597
void updateEntry(const QString &address, const QString &label, bool isMine, const QString &purpose, int status)

src/qt/recentrequeststablemodel.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
#include <clientversion.h>
1212
#include <streams.h>
1313

14+
#include <algorithm>
15+
1416

1517
RecentRequestsTableModel::RecentRequestsTableModel(WalletModel *parent) :
1618
QAbstractTableModel(parent), walletModel(parent)
@@ -202,7 +204,7 @@ void RecentRequestsTableModel::addNewRequest(RecentRequestEntry &recipient)
202204

203205
void RecentRequestsTableModel::sort(int column, Qt::SortOrder order)
204206
{
205-
qSort(list.begin(), list.end(), RecentRequestEntryLessThan(column, order));
207+
std::sort(list.begin(), list.end(), RecentRequestEntryLessThan(column, order));
206208
Q_EMIT dataChanged(index(0, 0, QModelIndex()), index(list.size() - 1, NUMBER_OF_COLUMNS - 1, QModelIndex()));
207209
}
208210

0 commit comments

Comments
 (0)