From cc2beddaa44fb1f0e0ca9eb51c5feaca368c00b0 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Tue, 13 May 2025 15:48:50 -0700 Subject: [PATCH] [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. --- lldb/source/Interpreter/Options.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/source/Interpreter/Options.cpp b/lldb/source/Interpreter/Options.cpp index fdadba62987d..4cf68db46615 100644 --- a/lldb/source/Interpreter/Options.cpp +++ b/lldb/source/Interpreter/Options.cpp @@ -1076,7 +1076,7 @@ llvm::Expected 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()); }