Merge pull request #598 from simartin/useless_str_check
Removed unnecessary string comparison in Tokenizer::simplifyKnownVariablesSimplify
This commit is contained in:
commit
f1c4cc6d55
|
@ -6820,10 +6820,10 @@ bool Tokenizer::simplifyKnownVariablesSimplify(Token **tok2, Token *tok3, unsign
|
|||
}
|
||||
|
||||
// Delete pointer alias
|
||||
if (pointeralias && tok3->str() == "delete" &&
|
||||
(Token::Match(tok3, "delete %varid% ;", varid) ||
|
||||
Token::Match(tok3, "delete [ ] %varid%", varid))) {
|
||||
tok3 = (tok3->next() && tok3->next()->str() == "[") ? tok3->tokAt(3) : tok3->next();
|
||||
if (pointeralias && (tok3->str() == "delete") && tok3->next() &&
|
||||
(Token::Match(tok3->next(), "%varid% ;", varid) ||
|
||||
Token::Match(tok3->next(), "[ ] %varid%", varid))) {
|
||||
tok3 = (tok3->next()->str() == "[") ? tok3->tokAt(3) : tok3->next();
|
||||
tok3->str(value);
|
||||
tok3->varId(valueVarId);
|
||||
ret = true;
|
||||
|
|
Loading…
Reference in New Issue