qhttpnetworkreques: use range based for more
to improve readability Change-Id: I4d4342f45296e2d6f439c6a74292c6c922e95194 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>bb10
parent
a6027d4c59
commit
a10c8647b3
|
|
@ -112,7 +112,7 @@ QByteArray QHttpNetworkRequest::uri(bool throughProxy) const
|
|||
|
||||
QByteArray QHttpNetworkRequestPrivate::header(const QHttpNetworkRequest &request, bool throughProxy)
|
||||
{
|
||||
QList<QPair<QByteArray, QByteArray> > fields = request.header();
|
||||
const QList<QPair<QByteArray, QByteArray> > fields = request.header();
|
||||
QByteArray ba;
|
||||
ba.reserve(40 + fields.size()*25); // very rough lower bound estimation
|
||||
|
||||
|
|
@ -126,12 +126,10 @@ QByteArray QHttpNetworkRequestPrivate::header(const QHttpNetworkRequest &request
|
|||
ba += QByteArray::number(request.minorVersion());
|
||||
ba += "\r\n";
|
||||
|
||||
QList<QPair<QByteArray, QByteArray> >::const_iterator it = fields.constBegin();
|
||||
QList<QPair<QByteArray, QByteArray> >::const_iterator endIt = fields.constEnd();
|
||||
for (; it != endIt; ++it) {
|
||||
ba += it->first;
|
||||
for (const auto& [name, value] : fields) {
|
||||
ba += name;
|
||||
ba += ": ";
|
||||
ba += it->second;
|
||||
ba += value;
|
||||
ba += "\r\n";
|
||||
}
|
||||
if (request.d->operation == QHttpNetworkRequest::Post) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue