From 47439a7efd51b067b3820dc89f65aaa1c00ff77c Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sat, 30 Sep 2023 11:42:35 +0800 Subject: [PATCH] Use reference when parsing URL query PR #19659. --- src/base/http/requestparser.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/base/http/requestparser.cpp b/src/base/http/requestparser.cpp index 349d79e24..5b2b500a1 100644 --- a/src/base/http/requestparser.cpp +++ b/src/base/http/requestparser.cpp @@ -251,12 +251,9 @@ bool RequestParser::parsePostMessage(const QByteArrayView data) // [URL Standard] 5.1 application/x-www-form-urlencoded parsing const QByteArray processedData = data.toByteArray().replace('+', ' '); - QListIterator i(QUrlQuery(QString::fromUtf8(processedData)).queryItems(QUrl::FullyDecoded)); - while (i.hasNext()) - { - const QStringPair pair = i.next(); + const QList pairs = QUrlQuery(QString::fromUtf8(processedData)).queryItems(QUrl::FullyDecoded); + for (const QStringPair &pair : pairs) m_request.posts[pair.first] = pair.second; - } return true; }