Skip to content

Commit 7dcf216

Browse files
committed
Replace if with assert
on-behalf-of: @amd <[email protected]>
1 parent db17a4c commit 7dcf216

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@ void DefaultLambdaCaptureCheck::registerMatchers(MatchFinder *Finder) {
2727

2828
void DefaultLambdaCaptureCheck::check(const MatchFinder::MatchResult &Result) {
2929
const auto *Lambda = Result.Nodes.getNodeAs<LambdaExpr>("lambda");
30-
if (!Lambda)
31-
return;
32-
33-
// No need to check getCaptureDefault() != LCD_None since our custom matcher
34-
// hasDefaultCapture() already ensures this condition
30+
assert(Lambda);
3531

3632
SourceLocation DefaultCaptureLoc = Lambda->getCaptureDefaultLoc();
3733
if (DefaultCaptureLoc.isInvalid())

0 commit comments

Comments
 (0)