aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Interpreter
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2025-05-13 15:48:50 -0700
committerGitHub <noreply@github.com>2025-05-13 15:48:50 -0700
commitcc2beddaa44fb1f0e0ca9eb51c5feaca368c00b0 (patch)
tree84e97f676f3901aada2ae9a9bd798f22b0005742 /lldb/source/Interpreter
parent61272b5a1c6ca9287450705e24509370033f9451 (diff)
downloadllvm-cc2beddaa44fb1f0e0ca9eb51c5feaca368c00b0.zip
llvm-cc2beddaa44fb1f0e0ca9eb51c5feaca368c00b0.tar.gz
llvm-cc2beddaa44fb1f0e0ca9eb51c5feaca368c00b0.tar.bz2
[lldb] Use std:::string::find with std::string_view (NFC) (#139679)
std::string::find accepts anything that can be converted to std::string_view starting in C++17. Since StringRef can be converted to std::string_view, we do not need to create a temporary instance of std::string here.
Diffstat (limited to 'lldb/source/Interpreter')
-rw-r--r--lldb/source/Interpreter/Options.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/source/Interpreter/Options.cpp b/lldb/source/Interpreter/Options.cpp
index fdadba6..4cf68db 100644
--- a/lldb/source/Interpreter/Options.cpp
+++ b/lldb/source/Interpreter/Options.cpp
@@ -1076,7 +1076,7 @@ llvm::Expected<Args> Options::ParseAlias(const Args &args,
if (!input_line.empty()) {
llvm::StringRef tmp_arg = args_copy[idx].ref();
- size_t pos = input_line.find(std::string(tmp_arg));
+ size_t pos = input_line.find(tmp_arg);
if (pos != std::string::npos)
input_line.erase(pos, tmp_arg.size());
}