Fix ticket #257 (Improve speed of template tokenizing)

http://apps.sourceforge.net/trac/cppcheck/ticket/257
This commit is contained in:
Reijo Tomperi 2009-04-14 23:21:52 +03:00
parent 3c3a56bfca
commit 23f00e64cb
1 changed files with 3 additions and 0 deletions

View File

@ -513,6 +513,9 @@ void Tokenizer::tokenize(std::istream &code, const char FileName[])
const std::string pattern(s + "> ");
for (Token *tok2 = _tokens; tok2; tok2 = tok2->next())
{
if (tok2->str() != name)
continue;
if (!Token::Match(tok2, (pattern + (isfunc ? "(" : "%var%")).c_str()))
continue;