match: optimisation

This commit is contained in:
Daniel Marjamäki 2009-01-10 07:10:18 +00:00
parent ae4ab2fcb6
commit d6d26f4705
1 changed files with 1 additions and 1 deletions

View File

@ -192,7 +192,7 @@ bool Token::Match(const Token *tok, const char pattern[], unsigned int varid)
if (!tok)
{
// If we have no tokens, pattern "!!else" should return true
if (str[1] == '!' && str[0] == '!' && strlen(str) > 2)
if (str[1] == '!' && str[0] == '!' && str[2] != '\0')
continue;
else
return false;