0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-02 09:46:52 -05:00

refactor: replace qStableSort with std::stable_sort

This commit is contained in:
fanquake 2019-08-21 09:42:29 +08:00
parent 8ee572f094
commit fea33cbbdf
No known key found for this signature in database
GPG key ID: 2EEB9F5CC09526C1
2 changed files with 6 additions and 2 deletions

View file

@ -10,6 +10,8 @@
#include <sync.h> #include <sync.h>
#include <util/time.h> #include <util/time.h>
#include <algorithm>
#include <QDebug> #include <QDebug>
#include <QList> #include <QList>
@ -61,7 +63,7 @@ public:
if (sortColumn >= 0) if (sortColumn >= 0)
// sort cachedBanlist (use stable sort to prevent rows jumping around unnecessarily) // sort cachedBanlist (use stable sort to prevent rows jumping around unnecessarily)
qStableSort(cachedBanlist.begin(), cachedBanlist.end(), BannedNodeLessThan(sortColumn, sortOrder)); std::stable_sort(cachedBanlist.begin(), cachedBanlist.end(), BannedNodeLessThan(sortColumn, sortOrder));
} }
int size() const int size() const

View file

@ -11,6 +11,8 @@
#include <interfaces/node.h> #include <interfaces/node.h>
#include <sync.h> #include <sync.h>
#include <algorithm>
#include <QDebug> #include <QDebug>
#include <QList> #include <QList>
#include <QTimer> #include <QTimer>
@ -76,7 +78,7 @@ public:
if (sortColumn >= 0) if (sortColumn >= 0)
// sort cacheNodeStats (use stable sort to prevent rows jumping around unnecessarily) // sort cacheNodeStats (use stable sort to prevent rows jumping around unnecessarily)
qStableSort(cachedNodeStats.begin(), cachedNodeStats.end(), NodeLessThan(sortColumn, sortOrder)); std::stable_sort(cachedNodeStats.begin(), cachedNodeStats.end(), NodeLessThan(sortColumn, sortOrder));
// build index map // build index map
mapNodeRows.clear(); mapNodeRows.clear();