From 433ae8abf427a54d517c31d9125ef8771a2a7b4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 15 Jan 2011 22:38:05 +0100 Subject: [PATCH] STL: Optimised checking --- lib/checkstl.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/checkstl.cpp b/lib/checkstl.cpp index e87c0d076..4743bc173 100644 --- a/lib/checkstl.cpp +++ b/lib/checkstl.cpp @@ -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)