qhttpmultipart: use range-for more

to improve readability

Change-Id: I9b7cad485c354b58b1acee7cea159988bf37c9df
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
Anton Kudryavtsev 2023-10-30 17:47:21 +03:00
parent 56bb4ac484
commit 8db967a860

View File

@ -386,10 +386,9 @@ void QHttpPartPrivate::checkHeaderCreated() const
{
if (!headerCreated) {
// copied from QHttpNetworkRequestPrivate::header() and adapted
QList<QPair<QByteArray, QByteArray> > fields = allRawHeaders();
QList<QPair<QByteArray, QByteArray> >::const_iterator it = fields.constBegin();
for (; it != fields.constEnd(); ++it)
header += it->first + ": " + it->second + "\r\n";
const auto fields = allRawHeaders();
for (const auto &[name, value] : fields)
header += name + ": " + value + "\r\n";
header += "\r\n";
headerCreated = true;
}