summaryrefslogtreecommitdiffstats
path: root/src/network/access/qnetworkreplyhttpimpl.cpp
diff options
context:
space:
mode:
authorJuha Vuolle <juha.vuolle@qt.io>2024-02-08 07:46:21 +0200
committerMarc Mutz <marc.mutz@qt.io>2024-02-08 15:02:52 +0000
commit7288db6083ea1e181fc8ac6e06c2ee3f603cf175 (patch)
tree52446a81f4187512b671836c7ab9415c55d9230a /src/network/access/qnetworkreplyhttpimpl.cpp
parent60f471f4b6269827fe2fcaa1f8fbe73db4abe8eb (diff)
Remove unnecessary case-insensitive header name comparisons
HTTP header name fields are case-insensitive and the QHttpHeaders class stores them as lower-case. Therefore the case-insensitive comparisons, when comparing against a lower-case value, are not needed. Pick-to: 6.7 Change-Id: I7f38ef16aa7c61103abc4c81c13aebdd6e535dc8 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'src/network/access/qnetworkreplyhttpimpl.cpp')
-rw-r--r--src/network/access/qnetworkreplyhttpimpl.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp
index a5f2d91f0d..26c0926c7f 100644
--- a/src/network/access/qnetworkreplyhttpimpl.cpp
+++ b/src/network/access/qnetworkreplyhttpimpl.cpp
@@ -1373,12 +1373,10 @@ void QNetworkReplyHttpImplPrivate::replyDownloadMetaData(const QHttpHeaders &hm,
// Reset any previous "location" header set in the reply. In case of
// redirects, we don't want to 'append' multiple location header values,
// rather we keep only the latest one
- if (key.compare(locationHeader(), Qt::CaseInsensitive) == 0)
+ if (key == locationHeader())
value.clear();
- if (shouldDecompress && !decompressHelper.isValid()
- && key.compare("content-encoding", Qt::CaseInsensitive) == 0) {
-
+ if (shouldDecompress && !decompressHelper.isValid() && key == "content-encoding"_L1) {
if (!synchronous) // with synchronous all the data is expected to be handled at once
decompressHelper.setCountingBytesEnabled(true);
@@ -1395,7 +1393,7 @@ void QNetworkReplyHttpImplPrivate::replyDownloadMetaData(const QHttpHeaders &hm,
if (!value.isEmpty()) {
// Why are we appending values for headers which are already
// present?
- if (key.compare("set-cookie", Qt::CaseInsensitive) == 0)
+ if (key == "set-cookie"_L1)
value += '\n';
else
value += ", ";