summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/linkgraph_sl.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/saveload/linkgraph_sl.cpp b/src/saveload/linkgraph_sl.cpp
index af2890244..7d4fe5671 100644
--- a/src/saveload/linkgraph_sl.cpp
+++ b/src/saveload/linkgraph_sl.cpp
@@ -20,8 +20,6 @@
typedef LinkGraph::BaseNode Node;
typedef LinkGraph::BaseEdge Edge;
-const SettingDesc *GetSettingDescription(uint index);
-
static uint16 _num_nodes;
/**
@@ -70,17 +68,10 @@ const SaveLoad *GetLinkGraphJobDesc()
/* Build the SaveLoad array on first call and don't touch it later on */
if (saveloads.size() == 0) {
- size_t prefixlen = strlen(prefix);
-
- int setting = 0;
- const SettingDesc *desc = GetSettingDescription(setting);
- while (desc != nullptr) {
- if (desc->name != nullptr && strncmp(desc->name, prefix, prefixlen) == 0) {
- SaveLoad sl = desc->save;
- sl.address_proc = proc;
- saveloads.push_back(sl);
- }
- desc = GetSettingDescription(++setting);
+ GetSettingSaveLoadByPrefix(prefix, saveloads);
+
+ for (auto &sl : saveloads) {
+ sl.address_proc = proc;
}
int i = 0;