From f4227967ce1aa6f8d65a273f48fbf98940f3e838 Mon Sep 17 00:00:00 2001 From: Thomas Jarosch Date: Tue, 15 Jan 2013 20:37:02 +0100 Subject: [PATCH] Simplify token string access "internal" check reported: [lib/tokenize.cpp:6671]: (style) Call to 'Token::tokAt()' followed by 'Token::str()' can be simplified. --- lib/tokenize.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index ac7694220..e34d71f2a 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -6668,7 +6668,7 @@ void Tokenizer::simplifyCharAt() // Replace "string"[0] with 's' for (Token *tok = list.front(); tok; tok = tok->next()) { if (Token::Match(tok, "%str% [ %num% ]")) { - const MathLib::bigint index = MathLib::toLongNumber(tok->tokAt(2)->str()); + const MathLib::bigint index = MathLib::toLongNumber(tok->strAt(2)); // Check within range if (index >= 0 && index <= (MathLib::bigint)Token::getStrLength(tok)) { tok->str(std::string("'" + Token::getCharAt(tok, (size_t)index) + "'"));