summaryrefslogtreecommitdiffstats
path: root/src/network/socket/qhttpsocketengine.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-01-26 14:38:54 +0100
committerMarc Mutz <marc.mutz@kdab.com>2016-05-04 05:21:25 +0000
commitf3af7fce4a9174fb80de22cf650435516c2f3796 (patch)
tree1132b8aad645d9e27b09cf2367866f2c10678061 /src/network/socket/qhttpsocketengine.cpp
parent347832d7593e2369f8597bbd06213b80b3087433 (diff)
QtNetwork: eradicate Q_FOREACH loops [rvalues]
... by replacing them with C++11 range-for loops. This is the simplest of the patch series: Q_FOREACH took a copy, so we do, too. Except we don't, since we're just catching the return value that comes out of the function (RVO). We can't feed the rvalues into range-for, because they are non-const and would thus detach. Change-Id: I42c9c44d948ab1512a69d42890187bc3cf2d7e58 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/network/socket/qhttpsocketengine.cpp')
-rw-r--r--src/network/socket/qhttpsocketengine.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/network/socket/qhttpsocketengine.cpp b/src/network/socket/qhttpsocketengine.cpp
index 642c9bb10f..73b42ba432 100644
--- a/src/network/socket/qhttpsocketengine.cpp
+++ b/src/network/socket/qhttpsocketengine.cpp
@@ -497,9 +497,9 @@ void QHttpSocketEngine::slotSocketConnected()
data += "Host: " + peerAddress + "\r\n";
if (!d->proxy.hasRawHeader("User-Agent"))
data += "User-Agent: Mozilla/5.0\r\n";
- foreach (const QByteArray &header, d->proxy.rawHeaderList()) {
+ const auto headers = d->proxy.rawHeaderList();
+ for (const QByteArray &header : headers)
data += header + ": " + d->proxy.rawHeader(header) + "\r\n";
- }
QAuthenticatorPrivate *priv = QAuthenticatorPrivate::getPrivate(d->authenticator);
//qDebug() << "slotSocketConnected: priv=" << priv << (priv ? (int)priv->method : -1);
if (priv && priv->method != QAuthenticatorPrivate::None) {