mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-06 13:11:25 -07:00
Merge pull request #11157 from Chocobo1/hostaddr
Construct QHostAddress more efficiently
This commit is contained in:
commit
1bb06a7428
1 changed files with 5 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue