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

Function lookupKeyConst

src/db.cpp:123–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121 }
122}
123static robj_roptr lookupKeyConst(redisDb *db, robj *key, int flags) {
124 serverAssert((flags & LOOKUP_UPDATEMVCC) == 0);
125 robj_roptr val;
126 if (g_pserver->m_pstorageFactory)
127 val = db->find(szFromObj(key)).val();
128 else
129 val = db->find_cached_threadsafe(szFromObj(key)).val();
130
131 if (val != nullptr) {
132 lookupKeyUpdateObj(val.unsafe_robjcast(), flags);
133 return val;
134 }
135 return nullptr;
136}
137
138/* Lookup a key for read operations, or return NULL if the key is not found
139 * in the specified DB.

Callers 1

lookupKeyReadWithFlagsFunction · 0.85

Calls 6

szFromObjFunction · 0.85
lookupKeyUpdateObjFunction · 0.85
unsafe_robjcastMethod · 0.80
valMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected