Codechange: replace StrStartsWith/StrEndsWith with starts_with and ends_with

This commit is contained in:
Rubidium
2024-01-17 06:30:44 +01:00
committed by rubidium42
parent 384b804f9c
commit 2d77cf9c80
16 changed files with 21 additions and 231 deletions

View File

@@ -1604,7 +1604,7 @@ static const SettingDesc *GetSettingFromName(const std::string_view name, const
for (auto &desc : settings) {
const SettingDesc *sd = GetSettingDesc(desc);
if (!SlIsObjectCurrentlyValid(sd->save.version_from, sd->save.version_to)) continue;
if (StrEndsWith(sd->GetName(), short_name_suffix)) return sd;
if (sd->GetName().ends_with(short_name_suffix)) return sd;
}
return nullptr;
@@ -1633,7 +1633,7 @@ void GetSaveLoadFromSettingTable(SettingTable settings, std::vector<SaveLoad> &s
static const SettingDesc *GetCompanySettingFromName(std::string_view name)
{
static const std::string_view company_prefix = "company.";
if (StrStartsWith(name, company_prefix)) name.remove_prefix(company_prefix.size());
if (name.starts_with(company_prefix)) name.remove_prefix(company_prefix.size());
return GetSettingFromName(name, _company_settings);
}