Skip to content

Commit fea33cb

Browse files
committed
refactor: replace qStableSort with std::stable_sort
1 parent 8ee572f commit fea33cb

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/qt/bantablemodel.cpp

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

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

@@ -61,7 +63,7 @@ class BanTablePriv
6163

6264
if (sortColumn >= 0)
6365
// sort cachedBanlist (use stable sort to prevent rows jumping around unnecessarily)
64-
qStableSort(cachedBanlist.begin(), cachedBanlist.end(), BannedNodeLessThan(sortColumn, sortOrder));
66+
std::stable_sort(cachedBanlist.begin(), cachedBanlist.end(), BannedNodeLessThan(sortColumn, sortOrder));
6567
}
6668

6769
int size() const

src/qt/peertablemodel.cpp

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

14+
#include <algorithm>
15+
1416
#include <QDebug>
1517
#include <QList>
1618
#include <QTimer>
@@ -76,7 +78,7 @@ class PeerTablePriv
7678

7779
if (sortColumn >= 0)
7880
// sort cacheNodeStats (use stable sort to prevent rows jumping around unnecessarily)
79-
qStableSort(cachedNodeStats.begin(), cachedNodeStats.end(), NodeLessThan(sortColumn, sortOrder));
81+
std::stable_sort(cachedNodeStats.begin(), cachedNodeStats.end(), NodeLessThan(sortColumn, sortOrder));
8082

8183
// build index map
8284
mapNodeRows.clear();

0 commit comments

Comments
 (0)