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.
This commit is contained in:
rubidium42
2021-05-18 21:01:42 +02:00
committed by rubidium42
parent 425d50372f
commit 3bb6ce8827
11 changed files with 107 additions and 117 deletions

View File

@@ -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];