File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -67,15 +67,14 @@ void AvoidDefaultLambdaCaptureCheck::check(
67
67
}
68
68
}
69
69
70
- // Replace with new capture list
71
- std::string ReplacementText;
72
- if (AllCaptures.empty ()) {
73
- ReplacementText = " []" ;
74
- } else {
75
- ReplacementText = " [" + llvm::join (AllCaptures, " , " ) + " ]" ;
76
- }
70
+ const auto ReplacementText = [&AllCaptures]() -> std::string {
71
+ if (AllCaptures.empty ()) {
72
+ return " []" ;
73
+ }
74
+ return " [" + llvm::join (AllCaptures, " , " ) + " ]" ;
75
+ }();
77
76
78
- clang::SourceRange IntroducerRange = Lambda->getIntroducerRange ();
77
+ const clang::SourceRange IntroducerRange = Lambda->getIntroducerRange ();
79
78
if (IntroducerRange.isValid ()) {
80
79
Diag << clang::FixItHint::CreateReplacement (IntroducerRange,
81
80
ReplacementText);
You can’t perform that action at this time.
0 commit comments