QNetworkProxyFactory: don't re-call QUrl::scheme() in if-else chain.
... Just cache it. Change-Id: Iae70e09233b237d904ab100f46f8dc7ab9ac8e04 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
e5cd556cd1
commit
74a7454b37
@ -121,14 +121,15 @@ QList<QNetworkProxy> QNetworkProxyFactory::systemProxyForQuery(const QNetworkPro
|
||||
bool haveDirectConnection = false;
|
||||
foreach (const QUrl& url, rawProxies) {
|
||||
QNetworkProxy::ProxyType type;
|
||||
if (url.scheme() == QLatin1String("http")) {
|
||||
const QString scheme = url.scheme();
|
||||
if (scheme == QLatin1String("http")) {
|
||||
type = QNetworkProxy::HttpProxy;
|
||||
} else if (url.scheme() == QLatin1String("socks")
|
||||
|| url.scheme() == QLatin1String("socks5")) {
|
||||
} else if (scheme == QLatin1String("socks")
|
||||
|| scheme == QLatin1String("socks5")) {
|
||||
type = QNetworkProxy::Socks5Proxy;
|
||||
} else if (url.scheme() == QLatin1String("ftp")) {
|
||||
} else if (scheme == QLatin1String("ftp")) {
|
||||
type = QNetworkProxy::FtpCachingProxy;
|
||||
} else if (url.scheme() == QLatin1String("direct")) {
|
||||
} else if (scheme == QLatin1String("direct")) {
|
||||
type = QNetworkProxy::NoProxy;
|
||||
haveDirectConnection = true;
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user