mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-02-09 05:14:23 +00:00
Construct QHostAddress more efficiently
This commit is contained in:
parent
2d13f87ba4
commit
2a66bb3127
@ -168,8 +168,11 @@ bool PeerInfo::isPlaintextEncrypted() const
|
|||||||
|
|
||||||
PeerAddress PeerInfo::address() const
|
PeerAddress PeerInfo::address() const
|
||||||
{
|
{
|
||||||
return {QHostAddress(QString::fromStdString(m_nativeInfo.ip.address().to_string()))
|
// fast path for platforms which boost.asio internal struct maps to `sockaddr`
|
||||||
, m_nativeInfo.ip.port()};
|
return {QHostAddress(m_nativeInfo.ip.data()), m_nativeInfo.ip.port()};
|
||||||
|
// slow path for the others
|
||||||
|
//return {QHostAddress(QString::fromStdString(m_nativeInfo.ip.address().to_string()))
|
||||||
|
// , m_nativeInfo.ip.port()};
|
||||||
}
|
}
|
||||||
|
|
||||||
QString PeerInfo::client() const
|
QString PeerInfo::client() const
|
||||||
|
Loading…
x
Reference in New Issue
Block a user