summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMårten Nordheim <marten.nordheim@qt.io>2021-08-23 15:34:09 +0200
committerMårten Nordheim <marten.nordheim@qt.io>2021-08-26 12:32:26 +0000
commit4fee73c444894d6b94a32492fc4e8ac98ca12da5 (patch)
treea8c92561d1fc8c74f021c5a105c7bec89b5b7894 /src
parent0e9b75eab254be5ed684b762f7a7d0375cfd747b (diff)
QNetworkAccessManager: move #ifery out of if-condition
for legibility Change-Id: Id5bc2471e79bb8560cec46068cc72573f6adec34 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index 7725ac7a81..f1267024c0 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -1223,12 +1223,16 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera
#endif
#if QT_CONFIG(http)
- // Since Qt 5 we use the new QNetworkReplyHttpImpl
- if (scheme == QLatin1String("http") || scheme == QLatin1String("preconnect-http")
+ constexpr char16_t httpSchemes[][17] = {
+ u"http",
+ u"preconnect-http",
#ifndef QT_NO_SSL
- || scheme == QLatin1String("https") || scheme == QLatin1String("preconnect-https")
+ u"https",
+ u"preconnect-https",
#endif
- ) {
+ };
+ // Since Qt 5 we use the new QNetworkReplyHttpImpl
+ if (std::find(std::begin(httpSchemes), std::end(httpSchemes), scheme) != std::end(httpSchemes)) {
#ifndef QT_NO_SSL
if (isStrictTransportSecurityEnabled() && d->stsCache.isKnownHost(request.url())) {
QUrl stsUrl(request.url());