From e0b2258b035aa8659405684bc39a822269f42e38 Mon Sep 17 00:00:00 2001 From: Tian Shilin Date: Thu, 22 Aug 2024 14:59:28 +0800 Subject: [PATCH] fix: Redundant condition in tst_qdbustype When isValid is true, it must be true; when isValid is false, whether the conditional judgment is true or not 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 the readability of the code. Change-Id: Iab621d3d2948d249f6d8a2425bca3f5404c2e1a1 Reviewed-by: Alexey Edelev (cherry picked from commit 3819ad4ea42b707e7b786b3a8b942d1214533ba6) 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 63cb7d4a65..41cde91580 100644 --- a/tests/auto/dbus/qdbustype/tst_qdbustype.cpp +++ b/tests/auto/dbus/qdbustype/tst_qdbustype.cpp @@ -173,7 +173,7 @@ void tst_QDBusType::isValidFixedType() 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)