From 981804752add4aa957a2e35e2961796ddf0d519e Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Mon, 30 Oct 2023 18:25:59 +0300 Subject: [PATCH] qnetworkcookiejar: port internal functions to QSV MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I2f377ca63b2d376736fa8adff88c47616939dd23 Reviewed-by: MÃ¥rten Nordheim --- src/network/access/qnetworkcookiejar.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/network/access/qnetworkcookiejar.cpp b/src/network/access/qnetworkcookiejar.cpp index bbb62455a5e..c83fb0574e6 100644 --- a/src/network/access/qnetworkcookiejar.cpp +++ b/src/network/access/qnetworkcookiejar.cpp @@ -112,7 +112,7 @@ void QNetworkCookieJar::setAllCookies(const QList &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); } /*!