MCPcopy Create free account
hub / github.com/DFHack/dfhack / serialize_associations

Function serialize_associations

plugins/preserve-rooms.cpp:157–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157static string serialize_associations(const unordered_map<int32_t, vector<int32_t>> & data) {
158 vector<string> elems;
159 for (auto &[key, vec] : data) {
160 vector<int32_t> combined = vec;
161 combined.push_back(key);
162 elems.push_back(join_strings("/", combined));
163 }
164 return join_strings(",", elems);
165}
166
167static void store_associations(const unordered_map<int32_t, vector<int32_t>> & data, const char * suffix) {
168 get_config(suffix, true).set_str(serialize_associations(data));

Callers 2

store_associationsFunction · 0.85

Calls 1

join_stringsFunction · 0.50

Tested by

no test coverage detected