Codechange: remove const char* overloads when there are std::string_view and std::string& overloads

This commit is contained in:
Rubidium
2025-04-28 21:04:49 +02:00
committed by rubidium42
parent a5578166bb
commit 78250c3bba
13 changed files with 18 additions and 24 deletions

View File

@@ -520,7 +520,7 @@ struct GameOptionsWindow : Window {
bool hide_language = IsReleasedVersion() && !_languages[i].IsReasonablyFinished();
if (hide_language) continue;
bool hide_percentage = IsReleasedVersion() || _languages[i].missing < _settings_client.gui.missing_strings_threshold;
char *name;
std::string name;
if (&_languages[i] == _current_language) {
*selected_index = i;
name = _languages[i].own_name;
@@ -533,10 +533,10 @@ struct GameOptionsWindow : Window {
name = _languages[i].name;
}
if (hide_percentage) {
list.push_back(MakeDropDownListStringItem(name, i));
list.push_back(MakeDropDownListStringItem(std::move(name), i));
} else {
int percentage = (LANGUAGE_TOTAL_STRINGS - _languages[i].missing) * 100 / LANGUAGE_TOTAL_STRINGS;
list.push_back(MakeDropDownListStringItem(GetString(STR_GAME_OPTIONS_LANGUAGE_PERCENTAGE, name, percentage), i));
list.push_back(MakeDropDownListStringItem(GetString(STR_GAME_OPTIONS_LANGUAGE_PERCENTAGE, std::move(name), percentage), i));
}
}
std::sort(list.begin(), list.end(), DropDownListStringItem::NatSortFunc);