From ce7725cf85986814d1cb0d2c83b18193f0c734cd Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 4 Jul 2023 14:40:10 +0200 Subject: [PATCH] QtNetwork: replace clashing statics with lambdas II: isSeparator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Detected with -unity-build-batch-size 103. Here, we just replace one of the static functions with a lambda, because the transformed function was far away from the use site while the unchanged instances (in qhsts.cpp) had several brethren isFoo() functions and the use was close to the definition. Task-number: QTBUG-115031 Change-Id: Ib84a64cd8b9f20cad7806659990df76552c0c5e4 Reviewed-by: MÃ¥rten Nordheim (cherry picked from commit 586e07785ce276547d30502a8a44b212d37b95c7) Reviewed-by: Qt Cherry-pick Bot --- src/network/access/qnetworkreplyhttpimpl.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp index 9efdcc9a3e0..a847ff16a8d 100644 --- a/src/network/access/qnetworkreplyhttpimpl.cpp +++ b/src/network/access/qnetworkreplyhttpimpl.cpp @@ -37,12 +37,6 @@ using namespace QtMiscUtils; class QNetworkProxy; -static inline bool isSeparator(char c) -{ - static const char separators[] = "()<>@,;:\\\"/[]?={}"; - return isLWS(c) || strchr(separators, c) != nullptr; -} - // ### merge with nextField in cookiejar.cpp static QHash parseHttpOptionHeader(const QByteArray &header) { @@ -109,6 +103,11 @@ static QHash parseHttpOptionHeader(const QByteArray &hea ++pos; } } else { + const auto isSeparator = [](char c) { + static const char separators[] = "()<>@,;:\\\"/[]?={}"; + return isLWS(c) || strchr(separators, c) != nullptr; + }; + // case: token while (pos < header.size()) { char c = header.at(pos);