diff options
author | Michael Lutz <michi@icosahedron.de> | 2019-04-02 21:31:33 +0200 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2019-04-09 22:45:15 +0200 |
commit | e804173595d49a537503ea08bec4663117bae047 (patch) | |
tree | aca1af9b44daefab8ded671615d87e08a3a96059 /src/saveload | |
parent | c7b9987d081ae4e0103309b18c93deecc395dec9 (diff) | |
download | openttd-e804173595d49a537503ea08bec4663117bae047.tar.xz |
Codechange: If something is a vector of strings, use a vector of strings instead of an AutoFreeSmallVector.
Diffstat (limited to 'src/saveload')
-rw-r--r-- | src/saveload/game_sl.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/saveload/game_sl.cpp b/src/saveload/game_sl.cpp index 626afb17e..52e8ac521 100644 --- a/src/saveload/game_sl.cpp +++ b/src/saveload/game_sl.cpp @@ -129,14 +129,14 @@ static const SaveLoad _game_language_string[] = { SLE_END() }; -static void SaveReal_GSTR(LanguageStrings *ls) +static void SaveReal_GSTR(const LanguageStrings *ls) { _game_saveload_string = ls->language; _game_saveload_strings = (uint)ls->lines.size(); SlObject(NULL, _game_language_header); - for (uint i = 0; i < _game_saveload_strings; i++) { - _game_saveload_string = ls->lines[i]; + for (const auto &i : ls->lines) { + _game_saveload_string = i.c_str(); SlObject(NULL, _game_language_string); } } @@ -153,7 +153,7 @@ static void Load_GSTR() std::unique_ptr<LanguageStrings> ls(new LanguageStrings(_game_saveload_string != NULL ? _game_saveload_string : "")); for (uint i = 0; i < _game_saveload_strings; i++) { SlObject(NULL, _game_language_string); - ls->lines.push_back(stredup(_game_saveload_string != NULL ? _game_saveload_string : "")); + ls->lines.emplace_back(_game_saveload_string != NULL ? _game_saveload_string : ""); } _current_data->raw_strings.push_back(std::move(ls)); |