Skip to content

Commit f59ad6b

Browse files
mikerice1969chencha3
authored andcommitted
[clang-tidy][NFC] Remove unnecessary nullptr check on cast subexpr (llvm#85473)
The value of SubExpr is not null since getSubExpr would assert in that case. Remove the nullptr check. This avoids confusion since SubExpr is used without check later in the function.
1 parent cdb1dca commit f59ad6b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

clang-tools-extra/clang-tidy/readability/ImplicitBoolConversionCheck.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ void fixGenericExprCastToBool(DiagnosticBuilder &Diag,
8181

8282
const Expr *SubExpr = Cast->getSubExpr();
8383

84-
bool NeedInnerParens =
85-
SubExpr != nullptr && utils::fixit::areParensNeededForStatement(*SubExpr);
84+
bool NeedInnerParens = utils::fixit::areParensNeededForStatement(*SubExpr);
8685
bool NeedOuterParens =
8786
Parent != nullptr && utils::fixit::areParensNeededForStatement(*Parent);
8887

0 commit comments

Comments
 (0)