Skip to content

Commit 0788e64

Browse files
committed
Removed unused function expressionsHasSideEffects()
1 parent 71fda0e commit 0788e64

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

lib/checkother.cpp

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2535,31 +2535,6 @@ void CheckOther::incorrectStringBooleanError(const Token *tok, const std::string
25352535
reportError(tok, Severity::warning, "incorrectStringBooleanError", "Conversion of string literal " + string + " to bool always evaluates to true.");
25362536
}
25372537

2538-
//-----------------------------------------------------------------------------
2539-
// check for duplicate expressions in if statements
2540-
// if (a) { } else if (a) { }
2541-
//-----------------------------------------------------------------------------
2542-
2543-
static bool expressionHasSideEffects(const Token *first, const Token *last)
2544-
{
2545-
for (const Token *tok = first; tok != last->next(); tok = tok->next()) {
2546-
// check for assignment
2547-
if (tok->isAssignmentOp())
2548-
return true;
2549-
2550-
// check for inc/dec
2551-
else if (tok->type() == Token::eIncDecOp)
2552-
return true;
2553-
2554-
// check for function call
2555-
else if (Token::Match(tok, "%var% (") &&
2556-
!(Token::Match(tok, "c_str|string") || tok->isStandardType()))
2557-
return true;
2558-
}
2559-
2560-
return false;
2561-
}
2562-
25632538
//-----------------------------------------------------------------------------
25642539
// check for duplicate code in if and else branches
25652540
// if (a) { b = true; } else { b = true; }

0 commit comments

Comments
 (0)