CppEditor: Simplify

bugprone-branch-clone
readability-simplify-boolean-expr

Change-Id: Id30a155e224370713d23b4b534fb82f5e630f36c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Nikolai Kosjar
2019-10-31 16:03:18 +01:00
parent d1912784c8
commit d337d03ce1
4 changed files with 7 additions and 30 deletions

View File

@@ -581,21 +581,11 @@ static bool checkDeclarationForSplit(SimpleDeclarationAST *declaration)
for (SpecifierListAST *it = declaration->decl_specifier_list; it; it = it->next) {
SpecifierAST *specifier = it->value;
if (specifier->asEnumSpecifier() != nullptr)
return false;
else if (specifier->asClassSpecifier() != nullptr)
if (specifier->asEnumSpecifier() || specifier->asClassSpecifier())
return false;
}
if (!declaration->declarator_list)
return false;
else if (!declaration->declarator_list->next)
return false;
return true;
return declaration->declarator_list && declaration->declarator_list->next;
}
namespace {
@@ -3502,9 +3492,7 @@ public:
bool preVisit(AST *) override
{
if (m_done)
return false;
return true;
return !m_done;
}
void statement(StatementAST *stmt)