From c2f26d6d0b70e591c74bf6664e30288a2d63dc9a Mon Sep 17 00:00:00 2001 From: Maks Naumov Date: Sat, 7 Feb 2015 12:10:41 +0200 Subject: 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 Reviewed-by: Marc Mutz --- src/network/access/qnetworkcookiejar.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/network/access') 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::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; } -- cgit v1.2.3