From 22cce68b2c1e6dad566ef608996c0e1eefc19f85 Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Wed, 30 Aug 2023 14:11:51 +0300 Subject: [PATCH] qhttpnetworkrequest: use range based for more MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit to improve readability Change-Id: Iaffb3ab8e4a188ee7cba3d9afc527cf3038a8040 Reviewed-by: MÃ¥rten Nordheim --- src/network/access/qnetworkrequest.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp index c69eecb030..634a10d4a9 100644 --- a/src/network/access/qnetworkrequest.cpp +++ b/src/network/access/qnetworkrequest.cpp @@ -1310,10 +1310,8 @@ QList QNetworkHeadersPrivate::rawHeadersKeys() const { QList result; result.reserve(rawHeaders.size()); - RawHeadersList::ConstIterator it = rawHeaders.constBegin(), - end = rawHeaders.constEnd(); - for ( ; it != end; ++it) - result << it->first; + for (const auto &pair : rawHeaders) + result << pair.first; return result; } @@ -1341,10 +1339,8 @@ void QNetworkHeadersPrivate::setAllRawHeaders(const RawHeadersList &list) cookedHeaders.clear(); rawHeaders = list; - RawHeadersList::ConstIterator it = rawHeaders.constBegin(); - RawHeadersList::ConstIterator end = rawHeaders.constEnd(); - for ( ; it != end; ++it) - parseAndSetHeader(it->first, it->second); + for (const auto &[key, value] : std::as_const(rawHeaders)) + parseAndSetHeader(key, value); } void QNetworkHeadersPrivate::setCookedHeader(QNetworkRequest::KnownHeaders header,