From 56e5f5aefce6df0e54fbbd556d7bcdca3f167d12 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Mon, 22 Feb 2021 09:53:06 +0200 Subject: [PATCH] qt, refactor: Drop no longer used PeerTableModel::getRowByNodeId func --- src/qt/peertablemodel.cpp | 19 ------------------- src/qt/peertablemodel.h | 1 - 2 files changed, 20 deletions(-) diff --git a/src/qt/peertablemodel.cpp b/src/qt/peertablemodel.cpp index b876c9cb83d..a263e8870ce 100644 --- a/src/qt/peertablemodel.cpp +++ b/src/qt/peertablemodel.cpp @@ -20,13 +20,10 @@ class PeerTablePriv public: /** Local cache of peer information */ QList cachedNodeStats; - /** Index of rows by node ID */ - std::map mapNodeRows; /** Pull a full list of peers from vNodes into our cache */ void refreshPeers(interfaces::Node& node) { - { cachedNodeStats.clear(); interfaces::Node::NodesStats nodes_stats; @@ -40,13 +37,6 @@ class PeerTablePriv stats.nodeStateStats = std::get<2>(node_stats); cachedNodeStats.append(stats); } - } - - // build index map - mapNodeRows.clear(); - int row = 0; - for (const CNodeCombinedStats& stats : cachedNodeStats) - mapNodeRows.insert(std::pair(stats.nodeStats.nodeid, row++)); } int size() const @@ -193,12 +183,3 @@ void PeerTableModel::refresh() priv->refreshPeers(m_node); Q_EMIT layoutChanged(); } - -int PeerTableModel::getRowByNodeId(NodeId nodeid) -{ - std::map::iterator it = priv->mapNodeRows.find(nodeid); - if (it == priv->mapNodeRows.end()) - return -1; - - return it->second; -} diff --git a/src/qt/peertablemodel.h b/src/qt/peertablemodel.h index ea3170c61c4..9c7bc25da21 100644 --- a/src/qt/peertablemodel.h +++ b/src/qt/peertablemodel.h @@ -41,7 +41,6 @@ class PeerTableModel : public QAbstractTableModel public: explicit PeerTableModel(interfaces::Node& node, QObject* parent); ~PeerTableModel(); - int getRowByNodeId(NodeId nodeid); void startAutoRefresh(); void stopAutoRefresh();