| 338 | } |
| 339 | |
| 340 | static void parse_data_mtimes(HashMap<StringId64, u64> &mtimes |
| 341 | , const HashMap<StringId64, DynamicString> &data_index |
| 342 | , Buffer &json |
| 343 | ) |
| 344 | { |
| 345 | TempAllocator128 ta; |
| 346 | JsonObject obj(ta); |
| 347 | sjson::parse(obj, json); |
| 348 | |
| 349 | auto cur = json_object::begin(obj); |
| 350 | auto end = json_object::end(obj); |
| 351 | for (; cur != end; ++cur) { |
| 352 | JSON_OBJECT_SKIP_HOLE(obj, cur); |
| 353 | |
| 354 | StringId64 id; |
| 355 | id.parse(cur->first.data()); |
| 356 | |
| 357 | // Skip reading data that belongs to non-existent source file. |
| 358 | if (!hash_map::has(data_index, id)) |
| 359 | continue; |
| 360 | |
| 361 | TempAllocator64 ta; |
| 362 | DynamicString mtime_json(ta); |
| 363 | sjson::parse_string(mtime_json, cur->second); |
| 364 | |
| 365 | u64 mtime = strtoull(mtime_json.c_str(), NULL, 10); |
| 366 | hash_map::set(mtimes, id, mtime); |
| 367 | } |
| 368 | } |
| 369 | |
| 370 | static void read_data_mtimes(HashMap<StringId64, u64> &mtimes |
| 371 | , FilesystemDisk &data_fs |
no test coverage detected