From 4c98a7e67ba3ff25bc0e67cb5ff110edf071df22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Fri, 24 Sep 2010 20:56:21 +0200 Subject: [PATCH] Optimisation: Removed unused and slow code. The code was added to fix #1225 but it is now redundant. --- lib/checkother.cpp | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/lib/checkother.cpp b/lib/checkother.cpp index c5be20fe6..9c58fdd63 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -3086,24 +3086,8 @@ private: if (vartok->varId() == 0) 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 - if (!tok.isStandardType() && !isenum) + if (!tok.isStandardType()) { std::set dup; for (std::list::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)); }