Skip to content

Commit 5cc2e24

Browse files
committed
Merge pull request cppcheck-opensource#401 from Dmitry-Me/avoidMutuallyExclusiveChecks
Avoid mutually exclusive checks
2 parents 3251aa9 + a386fbb commit 5cc2e24

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

lib/executionpath.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -412,13 +412,12 @@ void ExecutionPath::checkScope(const Token *tok, std::list<ExecutionPath *> &che
412412

413413
// parse next "if"..
414414
tok = tok->tokAt(2);
415-
if (tok && tok->str() == "if")
416-
continue;
417-
418415
if (!tok) {
419416
ExecutionPath::bailOut(newchecks);
420417
return;
421418
}
419+
if (tok->str() == "if")
420+
continue;
422421

423422
// there is no "if"..
424423
ExecutionPath::checkScope(tok->next(), checks);

0 commit comments

Comments
 (0)