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(
6767 }
6868 }
6969
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+ }();
7776
78- clang::SourceRange IntroducerRange = Lambda->getIntroducerRange ();
77+ const clang::SourceRange IntroducerRange = Lambda->getIntroducerRange ();
7978 if (IntroducerRange.isValid ()) {
8079 Diag << clang::FixItHint::CreateReplacement (IntroducerRange,
8180 ReplacementText);
You can’t perform that action at this time.
0 commit comments