Skip to content

[NFC][lldb-dap] Avoid unnecessary copy in setBreakpoint #142179

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 1, 2025

Conversation

da-viper
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Member

llvmbot commented May 30, 2025

@llvm/pr-subscribers-lldb

Author: Ebuka Ezike (da-viper)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/142179.diff

1 Files Affected:

  • (modified) lldb/tools/lldb-dap/Handler/SetBreakpointsRequestHandler.cpp (+1-3)
diff --git a/lldb/tools/lldb-dap/Handler/SetBreakpointsRequestHandler.cpp b/lldb/tools/lldb-dap/Handler/SetBreakpointsRequestHandler.cpp
index 0ff88f62f8f51..5d336af740c99 100644
--- a/lldb/tools/lldb-dap/Handler/SetBreakpointsRequestHandler.cpp
+++ b/lldb/tools/lldb-dap/Handler/SetBreakpointsRequestHandler.cpp
@@ -7,8 +7,6 @@
 //===----------------------------------------------------------------------===//
 
 #include "DAP.h"
-#include "EventHelper.h"
-#include "JSONUtils.h"
 #include "Protocol/ProtocolRequests.h"
 #include "RequestHandler.h"
 #include <vector>
@@ -22,7 +20,7 @@ namespace lldb_dap {
 llvm::Expected<protocol::SetBreakpointsResponseBody>
 SetBreakpointsRequestHandler::Run(
     const protocol::SetBreakpointsArguments &args) const {
-  const auto response_breakpoints =
+  std::vector<protocol::Breakpoint> response_breakpoints =
       dap.SetSourceBreakpoints(args.source, args.breakpoints);
   return protocol::SetBreakpointsResponseBody{std::move(response_breakpoints)};
 }

@da-viper da-viper merged commit a2e093f into llvm:main Jun 1, 2025
13 checks passed
@da-viper da-viper deleted the do-not-copy-setbreakpoint branch June 2, 2025 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants