Skip to content

Commit a9509f3

Browse files
committed
remove AI comments
on-behalf-of: @amd <[email protected]>
1 parent dd65b90 commit a9509f3

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,32 +63,28 @@ void AvoidDefaultLambdaCaptureCheck::check(
6363
"lambda default captures are discouraged; "
6464
"prefer to capture specific variables explicitly");
6565

66-
// Build the complete replacement capture list
6766
std::vector<std::string> AllCaptures;
6867

69-
// Add explicit captures first (preserve their order)
7068
for (const auto &Capture : Lambda->explicit_captures()) {
7169
if (const auto CaptureText = generateImplicitCaptureText(Capture)) {
7270
AllCaptures.push_back(CaptureText.value());
7371
}
7472
}
7573

76-
// Add implicit captures (convert to explicit)
7774
for (const auto &Capture : Lambda->implicit_captures()) {
7875
if (const auto CaptureText = generateImplicitCaptureText(Capture)) {
7976
AllCaptures.push_back(CaptureText.value());
8077
}
8178
}
8279

83-
// Build the final capture list
80+
// Replace with new capture list
8481
std::string ReplacementText;
8582
if (AllCaptures.empty()) {
8683
ReplacementText = "[]";
8784
} else {
8885
ReplacementText = "[" + llvm::join(AllCaptures, ", ") + "]";
8986
}
9087

91-
// Replace the entire capture list with the explicit version
9288
SourceRange IntroducerRange = Lambda->getIntroducerRange();
9389
if (IntroducerRange.isValid()) {
9490
Diag << FixItHint::CreateReplacement(IntroducerRange, ReplacementText);

0 commit comments

Comments
 (0)