summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTian Shilin <[email protected]>2024-08-21 17:44:19 +0800
committerTian Shilin <[email protected]>2024-08-21 22:56:52 +0800
commit4cdc4c92425f30050d780d723293981b689e1619 (patch)
treecb7d9fcf469b69f0bcedc185d03731431acb8738
parent1e57371695752d4112fa59c89d38e58b977d55bc (diff)
fix: Redundant condition
If cacheSaveDevice is false, then if must be true; if cacheSaveDevice is true, then only need to judgewhether !cacheSaveDevice->isOpen() is true or not, sothe second judgment condition on cacheSaveDevice I thinkit is not necessary. eg: '!A || (A && B)' is equivalent to '!A || B' Change-Id: Ie8ff3424a1f859c1f5b7c0fd62e6896d464b522e Reviewed-by: Alexey Edelev <[email protected]>
-rw-r--r--src/network/access/qnetworkreplyhttpimpl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp
index b13e9296c89..2521abf0838 100644
--- a/src/network/access/qnetworkreplyhttpimpl.cpp
+++ b/src/network/access/qnetworkreplyhttpimpl.cpp
@@ -1048,7 +1048,7 @@ void QNetworkReplyHttpImplPrivate::initCacheSaveDevice()
if (cacheSaveDevice)
q->connect(cacheSaveDevice, SIGNAL(aboutToClose()), SLOT(_q_cacheSaveDeviceAboutToClose()));
- if (!cacheSaveDevice || (cacheSaveDevice && !cacheSaveDevice->isOpen())) {
+ if (!cacheSaveDevice || !cacheSaveDevice->isOpen()) {
if (Q_UNLIKELY(cacheSaveDevice && !cacheSaveDevice->isOpen()))
qCritical("QNetworkReplyImpl: network cache returned a device that is not open -- "
"class %s probably needs to be fixed",