MCPcopy Create free account
hub / github.com/BYVoid/OpenCC / PruneExpiredDictCache

Function PruneExpiredDictCache

src/Config.cpp:71–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71void PruneExpiredDictCache() {
72 std::unordered_map<std::string, std::weak_ptr<Dict>>& cache = DictCache();
73 for (std::unordered_map<std::string, std::weak_ptr<Dict>>::iterator it =
74 cache.begin();
75 it != cache.end();) {
76 if (it->second.expired()) {
77 it = cache.erase(it);
78 } else {
79 ++it;
80 }
81 }
82}
83
84bool GetFileCacheKey(const std::string& path, std::string* cacheKey) {
85#if defined(_WIN32) || defined(_WIN64)

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected