mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-04 14:42:29 -06:00
Speed up lookup time
By adding another variable we can get O(1) lookup time instead of O(n).
Fix up 5f415c292d.
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#define PEERLISTWIDGET_H
|
||||
|
||||
#include <QHash>
|
||||
#include <QSet>
|
||||
#include <QTreeView>
|
||||
|
||||
class QHostAddress;
|
||||
@@ -85,6 +86,7 @@ private:
|
||||
PropertiesWidget *m_properties = nullptr;
|
||||
Net::ReverseResolution *m_resolver = nullptr;
|
||||
QHash<PeerEndpoint, QStandardItem *> m_peerItems;
|
||||
QHash<QHostAddress, QSet<QStandardItem *>> m_itemsByIP; // must be kept in sync with `m_peerItems`
|
||||
bool m_resolveCountries;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user