Skip to content

Commit e0c06b3

Browse files
committed
Fix
1 parent 1f2bbf5 commit e0c06b3

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

lib/checkother.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2442,10 +2442,8 @@ void CheckOtherImpl::constStatementError(const Token *tok, const std::string &ty
24422442
}
24432443
else if (!tok)
24442444
msg = "Redundant code: Found a statement that begins with " + type + " constant.";
2445-
else if (tok->isCast() && tok->tokType() == Token::Type::eExtendedOp) {
2446-
msg = "Redundant code: Found unused cast ";
2447-
msg += tok ? "in expression '" + tok->expressionString() + "'." : "expression.";
2448-
}
2445+
else if (tok->isCast() && tok->tokType() == Token::Type::eExtendedOp)
2446+
msg = "Redundant code: Found unused cast in expression '" + tok->expressionString() + "'.";
24492447
else if (tok->str() == "?" && tok->tokType() == Token::Type::eExtendedOp)
24502448
msg = "Redundant code: Found unused result of ternary operator.";
24512449
else if (tok->str() == "." && tok->tokType() == Token::Type::eOther)

0 commit comments

Comments
 (0)