[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.
This commit is contained in:
Kazu Hirata
2025-05-13 15:48:50 -07:00
committed by GitHub
parent 61272b5a1c
commit cc2beddaa4

View File

@@ -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());
}