forked from OSchip/llvm-project
[NFC] Remove redundant string copy
This commit is contained in:
parent
58f3201a20
commit
bcbea2ab84
|
@ -69,10 +69,8 @@ public:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We need to capture an owning-string in the lambda because the lambda
|
auto DumpWithIndent = [this, DoAddChild,
|
||||||
// is invoked in a deferred manner.
|
Label(Label.str())](bool IsLastChild) {
|
||||||
std::string LabelStr(Label);
|
|
||||||
auto DumpWithIndent = [this, DoAddChild, LabelStr](bool IsLastChild) {
|
|
||||||
// Print out the appropriate tree structure and work out the prefix for
|
// Print out the appropriate tree structure and work out the prefix for
|
||||||
// children of this node. For instance:
|
// children of this node. For instance:
|
||||||
//
|
//
|
||||||
|
@ -89,8 +87,8 @@ public:
|
||||||
OS << '\n';
|
OS << '\n';
|
||||||
ColorScope Color(OS, ShowColors, IndentColor);
|
ColorScope Color(OS, ShowColors, IndentColor);
|
||||||
OS << Prefix << (IsLastChild ? '`' : '|') << '-';
|
OS << Prefix << (IsLastChild ? '`' : '|') << '-';
|
||||||
if (!LabelStr.empty())
|
if (!Label.empty())
|
||||||
OS << LabelStr << ": ";
|
OS << Label << ": ";
|
||||||
|
|
||||||
this->Prefix.push_back(IsLastChild ? ' ' : '|');
|
this->Prefix.push_back(IsLastChild ? ' ' : '|');
|
||||||
this->Prefix.push_back(' ');
|
this->Prefix.push_back(' ');
|
||||||
|
|
Loading…
Reference in New Issue