Skip to content

Commit 73231c8

Browse files
committed
[NFC] Use llvm::twine to concat string
1 parent e4ffb48 commit 73231c8

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

clang-tools-extra/clang-tidy/modernize/UseStructuredBindingCheck.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -363,11 +363,10 @@ void UseStructuredBindingCheck::check(const MatchFinder::MatchResult &Result) {
363363
if (DS2)
364364
Hints.emplace_back(FixItHint::CreateRemoval(DS2->getSourceRange()));
365365

366-
std::string ReplacementText = Prefix.str() + " [" +
367-
FirstVar->getNameAsString() + ", " +
368-
SecondVar->getNameAsString() + "]";
369-
if (CFRS)
370-
ReplacementText += " :";
366+
std::string ReplacementText =
367+
(Twine(Prefix) + " [" + FirstVar->getNameAsString() + ", " +
368+
SecondVar->getNameAsString() + "]" + (CFRS ? " :" : ""))
369+
.str();
371370
diag(DiagLoc, "use structured binding to decompose a pair")
372371
<< FixItHint::CreateReplacement(ReplaceRange, ReplacementText) << Hints;
373372
};

0 commit comments

Comments
 (0)