Refactorization: Moved condition out of loop and ran AStyle

This commit is contained in:
PKEuS 2015-12-06 10:40:22 +01:00
parent 98f2cd021e
commit eb27d3b877
2 changed files with 8 additions and 9 deletions

View File

@ -1427,15 +1427,14 @@ bool SymbolDatabase::isFunction(const Token *tok, const Scope* outerScope, const
void SymbolDatabase::validate() const
{
const std::size_t functions = functionScopes.size();
for (std::size_t i = 0; i < functions; ++i) {
const Scope* scope = functionScopes[i];
const Function* function = scope->function;
if (scope->isExecutable() && !function) {
if (_settings->debugwarnings)
{
if (_settings->debugwarnings) {
const std::size_t functions = functionScopes.size();
for (std::size_t i = 0; i < functions; ++i) {
const Scope* scope = functionScopes[i];
const Function* function = scope->function;
if (scope->isExecutable() && !function) {
const std::list<const Token*> callstack(1, scope->classDef);
const std::string msg = std::string("executable scope '") + scope->classDef->str() + "' with unknown function";
const std::string msg = std::string("Executable scope '") + scope->classDef->str() + "' with unknown function.";
const ErrorLogger::ErrorMessage errmsg(callstack, &_tokenizer->list, Severity::debug,
"symbolDatabaseWarning",
msg,

View File

@ -1598,7 +1598,7 @@ private:
check("testing::testing()\n"
"{\n"
"}");
ASSERT_EQUALS("[test.cpp:1]: (debug) executable scope 'testing' with unknown function\n", errout.str());
ASSERT_EQUALS("[test.cpp:1]: (debug) Executable scope 'testing' with unknown function.\n", errout.str());
}
void symboldatabase5() {