diff --git a/examples/network/network-chat/peermanager.cpp b/examples/network/network-chat/peermanager.cpp index ce227b843c..1e25ffbff6 100644 --- a/examples/network/network-chat/peermanager.cpp +++ b/examples/network/network-chat/peermanager.cpp @@ -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()