Skip to content

Commit 317461e

Browse files
committed
[lldb-dap] Avoid a std::string allocation for the help output (NFC)
Don't create a temporary `std::string` for the help output, just write it to `llvm::outs()` directly.
1 parent 870b376 commit 317461e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lldb/tools/lldb-dap/lldb-dap.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ static void printHelp(LLDBDAPOptTable &table, llvm::StringRef tool_name) {
161161
std::string usage_str = tool_name.str() + " options";
162162
table.printHelp(llvm::outs(), usage_str.c_str(), "LLDB DAP", false);
163163

164-
std::string examples = R"___(
164+
llvm::outs() << R"___(
165165
EXAMPLES:
166166
The debug adapter can be started in two modes.
167167
@@ -176,7 +176,6 @@ static void printHelp(LLDBDAPOptTable &table, llvm::StringRef tool_name) {
176176
177177
lldb-dap -g
178178
)___";
179-
llvm::outs() << examples;
180179
}
181180

182181
// If --launch-target is provided, this instance of lldb-dap becomes a

0 commit comments

Comments
 (0)