summaryrefslogtreecommitdiffstats
path: root/src/network/access/qnetworkcookie.cpp
diff options
context:
space:
mode:
authorIsak Fyksen <[email protected]>2024-10-23 13:33:01 +0200
committerIsak Fyksen <[email protected]>2024-10-24 19:35:51 +0000
commita41c860c7dacfb6b785e0a24a4c3f26c3cde3c20 (patch)
tree905cc73da1265b2272b50a8b78c6a48482d33a69 /src/network/access/qnetworkcookie.cpp
parent95c70bbc5bed906fc3d24eebfb00592d48b30a74 (diff)
Replace all QPair/qMakePair with std::pair in qtbase/network
Task-number: QTBUG-115841 Change-Id: I34f3106e4b50a18cc19c4cda597205c346e7561e Reviewed-by: Mårten Nordheim <[email protected]> Reviewed-by: Øystein Heskestad <[email protected]>
Diffstat (limited to 'src/network/access/qnetworkcookie.cpp')
-rw-r--r--src/network/access/qnetworkcookie.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/network/access/qnetworkcookie.cpp b/src/network/access/qnetworkcookie.cpp
index 8ea5fdbe572..18e11e3ddbb 100644
--- a/src/network/access/qnetworkcookie.cpp
+++ b/src/network/access/qnetworkcookie.cpp
@@ -19,6 +19,8 @@
#include "QtNetwork/qhostaddress.h"
#include "private/qobject_p.h"
+#include <utility>
+
QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
@@ -376,7 +378,7 @@ void QNetworkCookie::setValue(const QByteArray &value)
}
// ### move this to qnetworkcookie_p.h and share with qnetworkaccesshttpbackend
-static QPair<QByteArray, QByteArray> nextField(QByteArrayView text, int &position, bool isNameValue)
+static std::pair<QByteArray, QByteArray> nextField(QByteArrayView text, int &position, bool isNameValue)
{
// format is one of:
// (1) token
@@ -392,7 +394,7 @@ static QPair<QByteArray, QByteArray> nextField(QByteArrayView text, int &positio
int equalsPosition = text.indexOf('=', position);
if (equalsPosition < 0 || equalsPosition > semiColonPosition) {
if (isNameValue)
- return qMakePair(QByteArray(), QByteArray()); //'=' is required for name-value-pair (RFC6265 section 5.2, rule 2)
+ return std::pair(QByteArray(), QByteArray()); //'=' is required for name-value-pair (RFC6265 section 5.2, rule 2)
equalsPosition = semiColonPosition; //no '=' means there is an attribute-name but no attribute-value
}
@@ -403,7 +405,7 @@ static QPair<QByteArray, QByteArray> nextField(QByteArrayView text, int &positio
second = text.mid(equalsPosition + 1, secondLength).trimmed().toByteArray();
position = semiColonPosition;
- return qMakePair(first, second);
+ return std::pair(first, second);
}
/*!
@@ -964,7 +966,7 @@ QList<QNetworkCookie> QNetworkCookiePrivate::parseSetCookieHeaderLine(QByteArray
QNetworkCookie cookie;
// The first part is always the "NAME=VALUE" part
- QPair<QByteArray,QByteArray> field = nextField(cookieString, position, true);
+ std::pair<QByteArray,QByteArray> field = nextField(cookieString, position, true);
if (field.first.isEmpty())
// parsing error
break;