[Lldb-commits] [lldb] [lldb-dap] Remove spurious move (NFC) (PR #140641)
via lldb-commits
lldb-commits at lists.llvm.org
Mon May 19 15:55:36 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: Jonas Devlieghere (JDevlieghere)
<details>
<summary>Changes</summary>
getArgumentsIfRequest is returning a local variable by value. Using std::move is not needed and may inhibit copy elision. Also fixes the braces around a single-line if.
---
Full diff: https://github.com/llvm/llvm-project/pull/140641.diff
1 Files Affected:
- (modified) lldb/tools/lldb-dap/DAP.cpp (+2-3)
``````````diff
diff --git a/lldb/tools/lldb-dap/DAP.cpp b/lldb/tools/lldb-dap/DAP.cpp
index af7a04a215fec..3419b2c3a841b 100644
--- a/lldb/tools/lldb-dap/DAP.cpp
+++ b/lldb/tools/lldb-dap/DAP.cpp
@@ -873,11 +873,10 @@ static std::optional<T> getArgumentsIfRequest(const Message &pm,
T args;
llvm::json::Path::Root root;
- if (!fromJSON(req->arguments, args, root)) {
+ if (!fromJSON(req->arguments, args, root))
return std::nullopt;
- }
- return std::move(args);
+ return args;
}
llvm::Error DAP::Loop() {
``````````
</details>
https://github.com/llvm/llvm-project/pull/140641
More information about the lldb-commits
mailing list