Skip to content

Commit 40d149d

Browse files
committed
Applying reviewer feedback.
1 parent 9090a31 commit 40d149d

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

lldb/tools/lldb-dap/DAP.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -701,9 +701,8 @@ bool DAP::HandleObject(const protocol::Message &M) {
701701
// Result should be given, use null if not.
702702
if (GetBoolean(object, "success").value_or(false)) {
703703
llvm::json::Value Result = nullptr;
704-
if (auto *B = object.get("body")) {
704+
if (auto *B = object.get("body"))
705705
Result = std::move(*B);
706-
}
707706
(*response_handler)(Result);
708707
} else {
709708
llvm::StringRef message = GetString(object, "message");
@@ -771,9 +770,8 @@ llvm::Error DAP::Loop() {
771770
});
772771
while (!disconnecting) {
773772
std::optional<protocol::Message> next = transport.Read();
774-
if (!next) {
773+
if (!next)
775774
break;
776-
}
777775

778776
if (!HandleObject(*next)) {
779777
return llvm::createStringError(llvm::inconvertibleErrorCode(),

lldb/tools/lldb-dap/Transport.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ static Expected<std::string> ReadUntil(IOObject *descriptor,
5555
/// ```
5656
/// Content-Length: (?<length>\d+)\r\n\r\n(?<content>.{\k<length>})
5757
/// ```
58-
static const StringLiteral kHeaderContentLength = "Content-Length: ";
59-
static const StringLiteral kHeaderSeparator = "\r\n\r\n";
58+
static constexpr StringLiteral kHeaderContentLength = "Content-Length: ";
59+
static constexpr StringLiteral kHeaderSeparator = "\r\n\r\n";
6060

6161
namespace lldb_dap {
6262

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,9 @@ serveConnection(const Socket::SocketProtocol &protocol, const std::string &name,
326326
std::thread client([=, &dap_sessions_condition, &dap_sessions_mutex,
327327
&dap_sessions]() {
328328
llvm::set_thread_name(client_name + ".runloop");
329-
Transport transport{client_name, log, io, io};
330-
DAP dap = DAP(program_path, log, default_repl_mode, pre_init_commands,
331-
client_name, transport);
329+
Transport transport(client_name, log, io, io);
330+
DAP dap(program_path, log, default_repl_mode, pre_init_commands,
331+
client_name, transport);
332332

333333
if (auto Err = dap.ConfigureIO()) {
334334
llvm::logAllUnhandledErrors(std::move(Err), llvm::errs(),
@@ -568,9 +568,9 @@ int main(int argc, char *argv[]) {
568568
stdout_fd, File::eOpenOptionWriteOnly, false);
569569

570570
std::string client_name = "stdin/stdout";
571-
Transport transport{client_name, log.get(), input, output};
572-
DAP dap = DAP(program_path, log.get(), default_repl_mode, pre_init_commands,
573-
client_name, transport);
571+
Transport transport(client_name, log.get(), input, output);
572+
DAP dap(program_path, log.get(), default_repl_mode, pre_init_commands,
573+
client_name, transport);
574574

575575
// stdout/stderr redirection to the IDE's console
576576
if (auto Err = dap.ConfigureIO(stdout, stderr)) {

0 commit comments

Comments
 (0)