Skip to content

Commit cc2bedd

Browse files
[lldb] Use std:::string::find with std::string_view (NFC) (llvm#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.
1 parent 61272b5 commit cc2bedd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lldb/source/Interpreter/Options.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,7 @@ llvm::Expected<Args> Options::ParseAlias(const Args &args,
10761076

10771077
if (!input_line.empty()) {
10781078
llvm::StringRef tmp_arg = args_copy[idx].ref();
1079-
size_t pos = input_line.find(std::string(tmp_arg));
1079+
size_t pos = input_line.find(tmp_arg);
10801080
if (pos != std::string::npos)
10811081
input_line.erase(pos, tmp_arg.size());
10821082
}

0 commit comments

Comments
 (0)