Skip to content

Commit 26f230f

Browse files
committed
[clang-tidy][NFC] Fix llvm-else-after-return findings
Fix issues found by clang-tidy in clang-tidy source directory.
1 parent aea4528 commit 26f230f

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,14 @@ static bool pointedUnqualifiedTypesAreEqual(QualType T1, QualType T2) {
5858
}
5959

6060
static clang::CharSourceRange getReplaceRange(const ExplicitCastExpr *Expr) {
61-
if (const auto *CastExpr = dyn_cast<CStyleCastExpr>(Expr)) {
61+
if (const auto *CastExpr = dyn_cast<CStyleCastExpr>(Expr))
6262
return CharSourceRange::getCharRange(
6363
CastExpr->getLParenLoc(),
6464
CastExpr->getSubExprAsWritten()->getBeginLoc());
65-
}
66-
if (const auto *CastExpr = dyn_cast<CXXFunctionalCastExpr>(Expr)) {
65+
if (const auto *CastExpr = dyn_cast<CXXFunctionalCastExpr>(Expr))
6766
return CharSourceRange::getCharRange(CastExpr->getBeginLoc(),
6867
CastExpr->getLParenLoc());
69-
} else
70-
llvm_unreachable("Unsupported CastExpr");
68+
llvm_unreachable("Unsupported CastExpr");
7169
}
7270

7371
static StringRef getDestTypeString(const SourceManager &SM,

clang-tools-extra/clang-tidy/modernize/LoopConvertCheck.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,8 @@ static std::optional<ContainerCall> getContainerExpr(const Expr *Call) {
375375
return ContainerCall{TheCall->getArg(0),
376376
TheCall->getDirectCallee()->getName(), false,
377377
CallKind};
378-
379-
} else if (const auto *TheCall = dyn_cast_or_null<CallExpr>(Dug)) {
378+
}
379+
if (const auto *TheCall = dyn_cast_or_null<CallExpr>(Dug)) {
380380
if (TheCall->getNumArgs() != 1)
381381
return std::nullopt;
382382

0 commit comments

Comments
 (0)