Skip to content

Commit 5a4a15d

Browse files
committed
qt, refactor: Drop no longer used PeerTableModel::getRowByNodeId func
1 parent 9a9f180 commit 5a4a15d

File tree

2 files changed

+0
-20
lines changed

2 files changed

+0
-20
lines changed

src/qt/peertablemodel.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,10 @@ class PeerTablePriv
2020
public:
2121
/** Local cache of peer information */
2222
QList<CNodeCombinedStats> cachedNodeStats;
23-
/** Index of rows by node ID */
24-
std::map<NodeId, int> mapNodeRows;
2523

2624
/** Pull a full list of peers from vNodes into our cache */
2725
void refreshPeers(interfaces::Node& node)
2826
{
29-
{
3027
cachedNodeStats.clear();
3128

3229
interfaces::Node::NodesStats nodes_stats;
@@ -40,13 +37,6 @@ class PeerTablePriv
4037
stats.nodeStateStats = std::get<2>(node_stats);
4138
cachedNodeStats.append(stats);
4239
}
43-
}
44-
45-
// build index map
46-
mapNodeRows.clear();
47-
int row = 0;
48-
for (const CNodeCombinedStats& stats : cachedNodeStats)
49-
mapNodeRows.insert(std::pair<NodeId, int>(stats.nodeStats.nodeid, row++));
5040
}
5141

5242
int size() const
@@ -198,12 +188,3 @@ void PeerTableModel::refresh()
198188
priv->refreshPeers(m_node);
199189
Q_EMIT layoutChanged();
200190
}
201-
202-
int PeerTableModel::getRowByNodeId(NodeId nodeid)
203-
{
204-
std::map<NodeId, int>::iterator it = priv->mapNodeRows.find(nodeid);
205-
if (it == priv->mapNodeRows.end())
206-
return -1;
207-
208-
return it->second;
209-
}

src/qt/peertablemodel.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ class PeerTableModel : public QAbstractTableModel
4141
public:
4242
explicit PeerTableModel(interfaces::Node& node, QObject* parent);
4343
~PeerTableModel();
44-
int getRowByNodeId(NodeId nodeid);
4544
void startAutoRefresh();
4645
void stopAutoRefresh();
4746

0 commit comments

Comments
 (0)