Skip to content

Commit

Permalink
[clang-tidy][NFC] Remove unnecessary nullptr check on cast subexpr (#…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
mikerice1969 committed Mar 18, 2024
1 parent f6f42af commit 57914f6
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ void fixGenericExprCastToBool(DiagnosticBuilder &Diag,

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

bool NeedInnerParens =
SubExpr != nullptr && utils::fixit::areParensNeededForStatement(*SubExpr);
bool NeedInnerParens = utils::fixit::areParensNeededForStatement(*SubExpr);
bool NeedOuterParens =
Parent != nullptr && utils::fixit::areParensNeededForStatement(*Parent);

Expand Down

0 comments on commit 57914f6

Please sign in to comment.