qnetworkcookiejar: port internal functions to QSV

Change-Id: I2f377ca63b2d376736fa8adff88c47616939dd23
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
Anton Kudryavtsev 2023-10-30 18:25:59 +03:00
parent 8db967a860
commit 981804752a

View File

@ -112,7 +112,7 @@ void QNetworkCookieJar::setAllCookies(const QList<QNetworkCookie> &cookieList)
d->allCookies = cookieList;
}
static inline bool isParentPath(const QString &path, const QString &reference)
static inline bool isParentPath(QStringView path, QStringView reference)
{
if ((path.isEmpty() && reference == "/"_L1) || path.startsWith(reference)) {
//The cookie-path and the request-path are identical.
@ -131,12 +131,12 @@ static inline bool isParentPath(const QString &path, const QString &reference)
return false;
}
static inline bool isParentDomain(const QString &domain, const QString &reference)
static inline bool isParentDomain(QStringView domain, QStringView reference)
{
if (!reference.startsWith(u'.'))
return domain == reference;
return domain.endsWith(reference) || domain == QStringView{reference}.mid(1);
return domain.endsWith(reference) || domain == reference.mid(1);
}
/*!