Make llvm::StringRef to std::string conversions explicit.
This is how it should've been and brings it more in line with std::string_view. There should be no functional change here. This is mostly mechanical from a custom clang-tidy check, with a lot of manual fixups. It uncovers a lot of minor inefficiencies. This doesn't actually modify StringRef yet, I'll do that in a follow-up.
This commit is contained in:
@@ -91,13 +91,13 @@ Status OptionGroupPythonClassWithDict::SetOptionValue(
|
||||
switch (option_idx) {
|
||||
case 0:
|
||||
case 3: {
|
||||
m_name.assign(option_arg);
|
||||
m_name.assign(std::string(option_arg));
|
||||
} break;
|
||||
case 1: {
|
||||
if (!m_dict_sp)
|
||||
m_dict_sp = std::make_shared<StructuredData::Dictionary>();
|
||||
if (m_current_key.empty())
|
||||
m_current_key.assign(option_arg);
|
||||
m_current_key.assign(std::string(option_arg));
|
||||
else
|
||||
error.SetErrorStringWithFormat("Key: \"%s\" missing value.",
|
||||
m_current_key.c_str());
|
||||
|
||||
Reference in New Issue
Block a user