Skip to content

Commit 969558e

Browse files
committed
simplify per code review
on-behalf-of: @amd <[email protected]>
1 parent b2c3cc2 commit 969558e

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
using namespace clang::tidy::readability;
1515

1616
static std::optional<std::string>
17-
generateImplicitCaptureText(const clang::LambdaCapture &Capture) {
17+
generateCaptureText(const clang::LambdaCapture &Capture) {
1818
if (Capture.capturesThis()) {
1919
return Capture.getCaptureKind() == clang::LCK_StarThis ? "*this" : "this";
2020
}
@@ -61,14 +61,8 @@ void AvoidDefaultLambdaCaptureCheck::check(
6161

6262
std::vector<std::string> AllCaptures;
6363

64-
for (const auto &Capture : Lambda->explicit_captures()) {
65-
if (const auto CaptureText = generateImplicitCaptureText(Capture)) {
66-
AllCaptures.push_back(CaptureText.value());
67-
}
68-
}
69-
70-
for (const auto &Capture : Lambda->implicit_captures()) {
71-
if (const auto CaptureText = generateImplicitCaptureText(Capture)) {
64+
for (const auto &Capture : Lambda->captures()) {
65+
if (const auto CaptureText = generateCaptureText(Capture)) {
7266
AllCaptures.push_back(CaptureText.value());
7367
}
7468
}

0 commit comments

Comments
 (0)