Network chat: simplify lookup function

Task-number: QTBUG-108873
Change-Id: I3ca0c976236003c708130ed120dba14cfbbf8185
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
Mårten Nordheim 2023-05-23 13:10:41 +02:00
parent 804b26b77d
commit e33bbdb0ea

View File

@ -56,11 +56,7 @@ void PeerManager::startBroadcasting()
bool PeerManager::isLocalHostAddress(const QHostAddress &address) const
{
for (const QHostAddress &localAddress : ipAddresses) {
if (address.isEqual(localAddress))
return true;
}
return false;
return ipAddresses.contains(address);
}
void PeerManager::sendBroadcastDatagram()