Optimisation: Removed unused and slow code. The code was added to fix #1225 but it is now redundant.

This commit is contained in:
Daniel Marjamäki 2010-09-24 20:56:21 +02:00
parent 8950beac37
commit 4c98a7e67b
1 changed files with 2 additions and 18 deletions

View File

@ -3086,24 +3086,8 @@ private:
if (vartok->varId() == 0) if (vartok->varId() == 0)
return; return;
bool isenum = false;
if (!tok.isStandardType())
{
const std::string pattern("enum " + tok.str());
for (const Token *tok2 = tok.previous(); tok2; tok2 = tok2->previous())
{
if (tok2->str() != "{")
continue;
if (Token::simpleMatch(tok2->tokAt(-2), pattern.c_str()))
{
isenum = true;
break;
}
}
}
// Suppress warnings if variable in inner scope has same name as variable in outer scope // Suppress warnings if variable in inner scope has same name as variable in outer scope
if (!tok.isStandardType() && !isenum) if (!tok.isStandardType())
{ {
std::set<unsigned int> dup; std::set<unsigned int> dup;
for (std::list<ExecutionPath *>::const_iterator it = checks.begin(); it != checks.end(); ++it) for (std::list<ExecutionPath *>::const_iterator it = checks.begin(); it != checks.end(); ++it)
@ -3120,7 +3104,7 @@ private:
} }
} }
if (a || p || tok.isStandardType() || isenum) if (a || p || tok.isStandardType())
checks.push_back(new CheckUninitVar(owner, vartok->varId(), vartok->str(), p, a)); checks.push_back(new CheckUninitVar(owner, vartok->varId(), vartok->str(), p, a));
} }