| 169 | } |
| 170 | |
| 171 | static void load_associations(unordered_map<int32_t, vector<int32_t>> * data, const char * suffix) { |
| 172 | PersistentDataItem c = get_config(suffix); |
| 173 | if (!c.isValid()) |
| 174 | return; |
| 175 | |
| 176 | vector<string> elems; |
| 177 | split_string(&elems, c.get_str(), ","); |
| 178 | for (auto elem : elems) { |
| 179 | vector<string> combined; |
| 180 | split_string(&combined, elem, "/"); |
| 181 | if (combined.size() <= 1) |
| 182 | continue; |
| 183 | int32_t key = string_to_int(combined.back(), -1); |
| 184 | combined.pop_back(); |
| 185 | vector<int32_t> vals; |
| 186 | for (auto str : combined) |
| 187 | vals.push_back(string_to_int(str, -1)); |
| 188 | data->emplace(key, vals); |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | static string serialize_noble_map(const unordered_map<int32_t, vector<string>> & data) { |
| 193 | vector<string> elems; |
no test coverage detected