| 342 | } |
| 343 | |
| 344 | void ApiWrap::LoadedFileCache::save( |
| 345 | const Location &location, |
| 346 | const QString &relativePath) { |
| 347 | if (!location) { |
| 348 | return; |
| 349 | } |
| 350 | const auto key = ComputeLocationKey(location); |
| 351 | _map[key] = relativePath; |
| 352 | _list.push_back(key); |
| 353 | if (_list.size() > _limit) { |
| 354 | const auto key = _list.front(); |
| 355 | _list.pop_front(); |
| 356 | _map.erase(key); |
| 357 | } |
| 358 | } |
| 359 | |
| 360 | std::optional<QString> ApiWrap::LoadedFileCache::find( |
| 361 | const Location &location) const { |
no test coverage detected