diff options
author | rubidium42 <rubidium@openttd.org> | 2021-05-18 21:01:42 +0200 |
---|---|---|
committer | rubidium42 <rubidium42@users.noreply.github.com> | 2021-05-27 18:49:43 +0200 |
commit | 3bb6ce8827b71ae1dcfde4a7836fb6c636fb5a67 (patch) | |
tree | 683666e0514c5acc04c698205a088c43afccc2ff /src/saveload/linkgraph_sl.cpp | |
parent | 425d50372fab501acc97981953a6c002c0a750cf (diff) | |
download | openttd-3bb6ce8827b71ae1dcfde4a7836fb6c636fb5a67.tar.xz |
Codechange: use initializer_lists for the settings tables
Not using vectors as those require copying from the initializer list and that
makes unique_ptrs to the actual SettingDesc objects later impossible.
Diffstat (limited to 'src/saveload/linkgraph_sl.cpp')
-rw-r--r-- | src/saveload/linkgraph_sl.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/saveload/linkgraph_sl.cpp b/src/saveload/linkgraph_sl.cpp index 3abf986e0..af2890244 100644 --- a/src/saveload/linkgraph_sl.cpp +++ b/src/saveload/linkgraph_sl.cpp @@ -74,7 +74,7 @@ const SaveLoad *GetLinkGraphJobDesc() int setting = 0; const SettingDesc *desc = GetSettingDescription(setting); - while (desc->save.cmd != SL_END) { + while (desc != nullptr) { if (desc->name != nullptr && strncmp(desc->name, prefix, prefixlen) == 0) { SaveLoad sl = desc->save; sl.address_proc = proc; @@ -86,7 +86,7 @@ const SaveLoad *GetLinkGraphJobDesc() int i = 0; do { saveloads.push_back(job_desc[i++]); - } while (saveloads[saveloads.size() - 1].cmd != SL_END); + } while (saveloads.back().cmd != SL_END); } return &saveloads[0]; |