| 27 | namespace detail { |
| 28 | |
| 29 | bool NumpyHeaderCache::GetFromCache(const string &file_name, numpy::HeaderData &header) { |
| 30 | if (!cache_headers_) { |
| 31 | return false; |
| 32 | } |
| 33 | std::unique_lock<std::mutex> cache_lock(cache_mutex_); |
| 34 | auto it = header_cache_.find(file_name); |
| 35 | if (it == header_cache_.end()) { |
| 36 | return false; |
| 37 | } else { |
| 38 | header = it->second; |
| 39 | return true; |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | void NumpyHeaderCache::UpdateCache(const string &file_name, const numpy::HeaderData &value) { |
| 44 | if (cache_headers_) { |
no test coverage detected