mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 15:07:22 -06:00
Cache country lookup result in PeerInfo class
The country lookup happens quite often when "Resolve peer countries" option is enabled.
This commit is contained in:
@@ -64,7 +64,9 @@ bool PeerInfo::fromLSD() const
|
||||
#ifndef DISABLE_COUNTRIES_RESOLUTION
|
||||
QString PeerInfo::country() const
|
||||
{
|
||||
return Net::GeoIPManager::instance()->lookup(address().ip);
|
||||
if (m_country.isEmpty())
|
||||
m_country = Net::GeoIPManager::instance()->lookup(address().ip);
|
||||
return m_country;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user