STL: Optimised checking
This commit is contained in:
parent
bb2862bc97
commit
433ae8abf4
|
@ -684,10 +684,9 @@ void CheckStl::stlBoundries()
|
||||||
for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next())
|
for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next())
|
||||||
{
|
{
|
||||||
// Declaring iterator..
|
// Declaring iterator..
|
||||||
const std::string checkStr = (std::string(STL_CONTAINER_LIST) + " <");
|
if (tok->str() == "<" && Token::Match(tok->previous(), STL_CONTAINER_LIST))
|
||||||
if (Token::Match(tok, checkStr.c_str()))
|
|
||||||
{
|
{
|
||||||
const std::string container_name(tok->strAt(0));
|
const std::string container_name(tok->strAt(-1));
|
||||||
while (tok && tok->str() != ">")
|
while (tok && tok->str() != ">")
|
||||||
tok = tok->next();
|
tok = tok->next();
|
||||||
if (!tok)
|
if (!tok)
|
||||||
|
|
Loading…
Reference in New Issue