| 1387 | } |
| 1388 | |
| 1389 | static bool _load_map_cache(const string &filename, const string &cachename) |
| 1390 | { |
| 1391 | _check_des_index_dir(); |
| 1392 | if (!crawl_state.use_des_cache) |
| 1393 | return false; |
| 1394 | |
| 1395 | const string descache_base = get_descache_path(cachename, ""); |
| 1396 | |
| 1397 | file_lock deslock(descache_base + ".lk", "rb", false); |
| 1398 | |
| 1399 | // What's the point in checking these twice (here and in load_ma_index)? |
| 1400 | time_t mtime = file_modtime(filename); |
| 1401 | if (!_verify_map_index(descache_base, mtime) |
| 1402 | || !_verify_map_full(descache_base, mtime)) |
| 1403 | { |
| 1404 | return false; |
| 1405 | } |
| 1406 | |
| 1407 | return _load_map_index(cachename, descache_base, mtime); |
| 1408 | } |
| 1409 | |
| 1410 | static void _write_map_prelude(const string &filebase, time_t mtime) |
| 1411 | { |
no test coverage detected