| 183 | } |
| 184 | |
| 185 | json::Array CreateMapBaseData(const MapBaseObj* value) { |
| 186 | json::Array data; |
| 187 | data.reserve(static_cast<int64_t>(value->size()) * 2); |
| 188 | for (const auto& [key, val] : *value) { |
| 189 | data.push_back(GetOrCreateNodeIndex(key)); |
| 190 | data.push_back(GetOrCreateNodeIndex(val)); |
| 191 | } |
| 192 | return data; |
| 193 | } |
| 194 | |
| 195 | // create the data for the object, if the type has a custom data to json function, |
| 196 | // use it. otherwise, we go over the fields and create the data. |