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

Function hashTypeLookupWriteOrCreate

src/t_hash.cpp:454–463  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

452}
453
454robj *hashTypeLookupWriteOrCreate(client *c, robj *key) {
455 robj *o = lookupKeyWrite(c->db,key);
456 if (checkType(c,o,OBJ_HASH)) return NULL;
457
458 if (o == NULL) {
459 o = createHashObject();
460 dbAdd(c->db,key,o);
461 }
462 return o;
463}
464
465void hashTypeConvertZiplist(robj *o, int enc) {
466 serverAssert(o->encoding == OBJ_ENCODING_ZIPLIST);

Callers 4

hsetnxCommandFunction · 0.85
hsetCommandFunction · 0.85
hincrbyCommandFunction · 0.85
hincrbyfloatCommandFunction · 0.85

Calls 4

lookupKeyWriteFunction · 0.85
checkTypeFunction · 0.85
createHashObjectFunction · 0.85
dbAddFunction · 0.85

Tested by

no test coverage detected