Merge pull request #408 from Dmitry-Me/continueEarlyToOmitUnneededActions2
Continue early to omit unneeded operations
This commit is contained in:
commit
c242faf45e
|
@ -550,11 +550,12 @@ void CheckStl::pushback()
|
||||||
if (Token::Match(tok, "%var% = & %var% [")) {
|
if (Token::Match(tok, "%var% = & %var% [")) {
|
||||||
// Variable id for pointer
|
// Variable id for pointer
|
||||||
const unsigned int pointerId(tok->varId());
|
const unsigned int pointerId(tok->varId());
|
||||||
|
if( pointerId == 0 )
|
||||||
|
continue;
|
||||||
|
|
||||||
// Variable id for the container variable
|
// Variable id for the container variable
|
||||||
const unsigned int containerId(tok->tokAt(3)->varId());
|
const unsigned int containerId(tok->tokAt(3)->varId());
|
||||||
|
if (containerId == 0)
|
||||||
if (pointerId == 0 || containerId == 0)
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
bool invalidPointer = false;
|
bool invalidPointer = false;
|
||||||
|
|
Loading…
Reference in New Issue