Skip to content

Commit 895fa78

Browse files
Remove useless in if-statements
Co-authored-by: Congcong Cai <[email protected]>
1 parent bd9db71 commit 895fa78

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

clang-tools-extra/clang-tidy/bugprone/ExceptionEscapeCheck.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,8 @@ void ExceptionEscapeCheck::check(const MatchFinder::MatchResult &Result) {
8181
const utils::ExceptionAnalyzer::ExceptionInfo Info =
8282
Tracer.analyze(MatchedDecl);
8383

84-
if (Info.getBehaviour() != utils::ExceptionAnalyzer::State::Throwing) {
84+
if (Info.getBehaviour() != utils::ExceptionAnalyzer::State::Throwing)
8585
return;
86-
}
8786

8887
diag(MatchedDecl->getLocation(), "an exception may be thrown in function "
8988
"%0 which should not throw exceptions")
@@ -92,9 +91,8 @@ void ExceptionEscapeCheck::check(const MatchFinder::MatchResult &Result) {
9291
const utils::ExceptionAnalyzer::ExceptionInfo::ThrowInfo ThrowInfo =
9392
Info.getExceptions().begin()->getSecond();
9493

95-
if (ThrowInfo.Loc.isInvalid()) {
94+
if (ThrowInfo.Loc.isInvalid())
9695
return;
97-
}
9896

9997
const utils::ExceptionAnalyzer::CallStack &Stack = ThrowInfo.Stack;
10098
diag(ThrowInfo.Loc,

0 commit comments

Comments
 (0)