MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / cacheKey

Method cacheKey

src/StorageCache.cpp:59–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59void StorageCache::cacheKey(sds key)
60{
61 if (m_pdict == nullptr)
62 return;
63 uintptr_t hash = dictSdsHash(key);
64 if (dictAdd(m_pdict, reinterpret_cast<void*>(hash), (void*)1) != DICT_OK) {
65 dictEntry *de = dictFind(m_pdict, reinterpret_cast<void*>(hash));
66 serverAssert(de != nullptr);
67 de->v.s64++;
68 m_collisionCount++;
69 }
70}
71
72void StorageCache::cacheKey(const char *rgch, size_t cch)
73{

Callers 1

key_load_itrMethod · 0.80

Calls 4

dictSdsHashFunction · 0.70
dictAddFunction · 0.70
dictFindFunction · 0.70
dictGenHashFunctionFunction · 0.70

Tested by

no test coverage detected