[Lldb-commits] [lldb] [lldb] Avoid creating a temporary instance of std::string (NFC) (PR #142294)
Kazu Hirata via lldb-commits
lldb-commits at lists.llvm.org
Sat May 31 15:45:54 PDT 2025
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/142294
GetExceptionBreakpoint takes StringRef to look for a matching
breakpoint, so we don't need to create a temporary instance of
std::string on our own.
>From 9004075793013620dd5bf2aa542b7fbe77415ceb Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Sat, 31 May 2025 15:18:33 -0700
Subject: [PATCH] [lldb] Avoid creating a temporary instance of std::string
(NFC)
GetExceptionBreakpoint takes StringRef to look for a matching
breakpoint, so we don't need to create a temporary instance of
std::string on our own.
---
.../lldb-dap/Handler/SetExceptionBreakpointsRequestHandler.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lldb/tools/lldb-dap/Handler/SetExceptionBreakpointsRequestHandler.cpp b/lldb/tools/lldb-dap/Handler/SetExceptionBreakpointsRequestHandler.cpp
index 09d4fea2a9a22..2214833f8a770 100644
--- a/lldb/tools/lldb-dap/Handler/SetExceptionBreakpointsRequestHandler.cpp
+++ b/lldb/tools/lldb-dap/Handler/SetExceptionBreakpointsRequestHandler.cpp
@@ -76,7 +76,7 @@ void SetExceptionBreakpointsRequestHandler::operator()(
for (const auto &value : *filters) {
const auto filter = GetAsString(value);
- auto *exc_bp = dap.GetExceptionBreakpoint(std::string(filter));
+ auto *exc_bp = dap.GetExceptionBreakpoint(filter);
if (exc_bp) {
exc_bp->SetBreakpoint();
unset_filters.erase(std::string(filter));
More information about the lldb-commits
mailing list