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
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to