Codechange: Pass unformatted strings from GetStringPtr as std::string_view. (#13871)

This commit is contained in:
frosch
2025-03-23 19:23:31 +01:00
committed by GitHub
parent 234c9fb3bd
commit 5aa4ad5135
8 changed files with 97 additions and 92 deletions

View File

@@ -315,10 +315,10 @@ GameStrings *_current_data = nullptr;
* @param id The ID of the game string.
* @return The encoded string.
*/
const char *GetGameStringPtr(StringIndexInTab id)
std::string_view GetGameStringPtr(StringIndexInTab id)
{
if (_current_data == nullptr || _current_data->cur_language == nullptr || id.base() >= _current_data->cur_language->lines.size()) return GetStringPtr(STR_UNDEFINED);
return _current_data->cur_language->lines[id].c_str();
return _current_data->cur_language->lines[id];
}
/**