| 94 | } |
| 95 | |
| 96 | void PruneExpiredPrefixMatchCache( |
| 97 | std::unordered_map<std::string, std::vector<CacheEntry>>* cache) { |
| 98 | for (std::unordered_map<std::string, std::vector<CacheEntry>>::iterator it = |
| 99 | cache->begin(); |
| 100 | it != cache->end();) { |
| 101 | std::vector<CacheEntry>& entries = it->second; |
| 102 | for (std::vector<CacheEntry>::iterator entry = entries.begin(); |
| 103 | entry != entries.end();) { |
| 104 | if (HasExpiredDict(*entry)) { |
| 105 | entry = entries.erase(entry); |
| 106 | } else { |
| 107 | ++entry; |
| 108 | } |
| 109 | } |
| 110 | if (entries.empty()) { |
| 111 | it = cache->erase(it); |
| 112 | } else { |
| 113 | ++it; |
| 114 | } |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | void Unreachable() { |
| 119 | #if defined(_MSC_VER) |
no test coverage detected