From 9de69c4a99e8413d9121b09c0a6ef2ee0b66a72a Mon Sep 17 00:00:00 2001 From: Tian Shilin Date: Thu, 22 Aug 2024 16:21:54 +0800 Subject: [PATCH] fix: Redundant condition in isValidBasicType When isValid is true, it must be true; when isValidis false, whether the conditional judgment is true ornot only depends on whether !result is true(eg: A | | (!A && B) is equivalent to A | | B.), so you can optimize the judgment condition to improve thereadability of the code. Change-Id: I0231b83e0b50586dff2820b8d0dfc35edec36f70 Reviewed-by: Thiago Macieira (cherry picked from commit 03c547f1010868a0ef2f236c6980094efab7e12f) Reviewed-by: Qt Cherry-pick Bot --- tests/auto/dbus/qdbustype/tst_qdbustype.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/dbus/qdbustype/tst_qdbustype.cpp b/tests/auto/dbus/qdbustype/tst_qdbustype.cpp index 41cde91580..b857d72b5e 100644 --- a/tests/auto/dbus/qdbustype/tst_qdbustype.cpp +++ b/tests/auto/dbus/qdbustype/tst_qdbustype.cpp @@ -195,7 +195,7 @@ void tst_QDBusType::isValidBasicType() QFETCH(bool, result); QFETCH(bool, isValid); QVERIFY2(data.size() == 1, "Test is malformed, this function must test only one-letter types"); - QVERIFY(isValid || (!isValid && !result)); + QVERIFY(isValid || !result); int type = data.at(0).unicode(); if (isValid)