diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index b4004eae14..90cde6654f 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -976,7 +976,7 @@ void QHttpNetworkConnectionPrivate::_q_hostLookupFinished(QHostInfo info) bool bIpv6 = false; bool foundAddress = false; - foreach (QHostAddress address, info.addresses()) { + foreach (const QHostAddress &address, info.addresses()) { if (address.protocol() == QAbstractSocket::IPv4Protocol) { if (!foundAddress) { foundAddress = true; diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index 91f10a0127..f84153a7bd 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -952,7 +952,7 @@ void QAbstractSocketPrivate::_q_startConnecting(const QHostInfo &hostInfo) if (preferredNetworkLayerProtocol == QAbstractSocket::UnknownNetworkLayerProtocol || preferredNetworkLayerProtocol == QAbstractSocket::AnyIPProtocol) { addresses = hostInfo.addresses(); } else { - foreach (QHostAddress address, hostInfo.addresses()) + foreach (const QHostAddress &address, hostInfo.addresses()) if (address.protocol() == preferredNetworkLayerProtocol) addresses += address; }