qhttpnetworkrequest: use range based for more
to improve readability Change-Id: Iaffb3ab8e4a188ee7cba3d9afc527cf3038a8040 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
parent
60133c364a
commit
22cce68b2c
@ -1310,10 +1310,8 @@ QList<QByteArray> QNetworkHeadersPrivate::rawHeadersKeys() const
|
|||||||
{
|
{
|
||||||
QList<QByteArray> result;
|
QList<QByteArray> result;
|
||||||
result.reserve(rawHeaders.size());
|
result.reserve(rawHeaders.size());
|
||||||
RawHeadersList::ConstIterator it = rawHeaders.constBegin(),
|
for (const auto &pair : rawHeaders)
|
||||||
end = rawHeaders.constEnd();
|
result << pair.first;
|
||||||
for ( ; it != end; ++it)
|
|
||||||
result << it->first;
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -1341,10 +1339,8 @@ void QNetworkHeadersPrivate::setAllRawHeaders(const RawHeadersList &list)
|
|||||||
cookedHeaders.clear();
|
cookedHeaders.clear();
|
||||||
rawHeaders = list;
|
rawHeaders = list;
|
||||||
|
|
||||||
RawHeadersList::ConstIterator it = rawHeaders.constBegin();
|
for (const auto &[key, value] : std::as_const(rawHeaders))
|
||||||
RawHeadersList::ConstIterator end = rawHeaders.constEnd();
|
parseAndSetHeader(key, value);
|
||||||
for ( ; it != end; ++it)
|
|
||||||
parseAndSetHeader(it->first, it->second);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QNetworkHeadersPrivate::setCookedHeader(QNetworkRequest::KnownHeaders header,
|
void QNetworkHeadersPrivate::setCookedHeader(QNetworkRequest::KnownHeaders header,
|
||||||
|
Loading…
Reference in New Issue
Block a user