MCPcopy Create free account
hub / github.com/chronoxor/CppServer / DeleteCacheValue

Method DeleteCacheValue

examples/https_server.cpp:61–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59 }
60
61 bool DeleteCacheValue(std::string_view key, std::string& value)
62 {
63 std::scoped_lock locker(_cache_lock);
64 auto it = _cache.find(key);
65 if (it != _cache.end())
66 {
67 value = it->second;
68 _cache.erase(it);
69 return true;
70 }
71 else
72 return false;
73 }
74
75private:
76 std::mutex _cache_lock;

Callers 1

onReceivedRequestMethod · 0.45

Calls 2

endMethod · 0.80
eraseMethod · 0.80

Tested by

no test coverage detected