From fd0155cacf6ff5dbcf40659878431d8107e67e1b Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Mon, 9 Feb 2015 10:23:36 +0300 Subject: [PATCH] Reuse already known values --- lib/valueflow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index 7c1a882d2..581693837 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -387,9 +387,9 @@ static void valueFlowString(TokenList *tokenlist) if (Token::Match(tok, "const char %var% [ %num%| ] = %str% ;")) { const Token *vartok = tok->tokAt(2); - const Token *strtok = tok->linkAt(3)->tokAt(2); + const Token *strtok = vartok->next()->link()->tokAt(2); constantStrings[vartok->varId()] = strtok; - tok = tok->tokAt(3); + tok = vartok->next(); } if (tok->varId() > 0U) {