summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorMaks Naumov <maksqwe1@ukr.net>2015-02-07 12:10:41 +0200
committerMaks Naumov <maksqwe1@ukr.net>2015-02-08 12:25:12 +0000
commitc2f26d6d0b70e591c74bf6664e30288a2d63dc9a (patch)
tree243d25d8fc79463ec7a3cc091e3da2574b89c4ff /src/network
parent163b8529516ddda24833f635f737863ba98bd688 (diff)
Use prefix instead of postfix for iterators
The postfix increment(decrement) creates a temp copy of *this before the modification and then returns that copy. It's needed only when using the old iterator and then incrementing it. Change-Id: I7f6702de78f5f987cec3556047e76049b4ee063a Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/network')
-rw-r--r--src/network/access/qnetworkcookiejar.cpp3
-rw-r--r--src/network/ssl/qsslkey_p.cpp4
2 files changed, 4 insertions, 3 deletions
diff --git a/src/network/access/qnetworkcookiejar.cpp b/src/network/access/qnetworkcookiejar.cpp
index d3e6f7b1c8..96f6006c09 100644
--- a/src/network/access/qnetworkcookiejar.cpp
+++ b/src/network/access/qnetworkcookiejar.cpp
@@ -307,11 +307,12 @@ bool QNetworkCookieJar::deleteCookie(const QNetworkCookie &cookie)
{
Q_D(QNetworkCookieJar);
QList<QNetworkCookie>::Iterator it;
- for (it = d->allCookies.begin(); it != d->allCookies.end(); it++)
+ for (it = d->allCookies.begin(); it != d->allCookies.end(); ++it) {
if (it->hasSameIdentifier(cookie)) {
d->allCookies.erase(it);
return true;
}
+ }
return false;
}
diff --git a/src/network/ssl/qsslkey_p.cpp b/src/network/ssl/qsslkey_p.cpp
index 99d502e8f9..350a7f2efc 100644
--- a/src/network/ssl/qsslkey_p.cpp
+++ b/src/network/ssl/qsslkey_p.cpp
@@ -153,8 +153,8 @@ QByteArray QSslKeyPrivate::pemFromDer(const QByteArray &der, const QMap<QByteArr
if (!headers.isEmpty()) {
QMap<QByteArray, QByteArray>::const_iterator it = headers.constEnd();
do {
- it--;
- extra += it.key() + ": " + it.value() + '\n';
+ --it;
+ extra += it.key() + ": " + it.value() + '\n';
} while (it != headers.constBegin());
extra += '\n';
}