STL: Optimised checking

This commit is contained in:
Daniel Marjamäki 2011-01-15 22:38:05 +01:00
parent bb2862bc97
commit 433ae8abf4
1 changed files with 2 additions and 3 deletions

View File

@ -684,10 +684,9 @@ void CheckStl::stlBoundries()
for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next())
{
// Declaring iterator..
const std::string checkStr = (std::string(STL_CONTAINER_LIST) + " <");
if (Token::Match(tok, checkStr.c_str()))
if (tok->str() == "<" && Token::Match(tok->previous(), STL_CONTAINER_LIST))
{
const std::string container_name(tok->strAt(0));
const std::string container_name(tok->strAt(-1));
while (tok && tok->str() != ">")
tok = tok->next();
if (!tok)