Reuse already known values
This commit is contained in:
parent
8a1b8df1ba
commit
fd0155cacf
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue