From 37dea8a5cf7fd6404700db6fc8c121c816dad783 Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Tue, 12 Sep 2017 23:20:07 +0300 Subject: [PATCH] Only check the value if it wasn't surely set by previous code --- lib/symboldatabase.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 980255121..75c298e49 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -1020,9 +1020,10 @@ void SymbolDatabase::createSymbolDatabaseNeedInitialization() scope->definedType->needInitialization = Type::True; else if (!unknown) scope->definedType->needInitialization = Type::False; - - if (scope->definedType->needInitialization == Type::Unknown) - unknowns++; + else { + if (scope->definedType->needInitialization == Type::Unknown) + unknowns++; + } } } else if (scope->type == Scope::eUnion && scope->definedType->needInitialization == Type::Unknown) scope->definedType->needInitialization = Type::True;