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

Function hashTypeGetFromHashTable

src/t_hash.cpp:96–104  ·  view source on GitHub ↗

Get the value from a hash table encoded hash, identified by field. * Returns NULL when the field cannot be found, otherwise the SDS value * is returned. */

Source from the content-addressed store, hash-verified

94 * Returns NULL when the field cannot be found, otherwise the SDS value
95 * is returned. */
96const char *hashTypeGetFromHashTable(robj_roptr o, const char *field) {
97 dictEntry *de;
98
99 serverAssert(o->encoding == OBJ_ENCODING_HT);
100
101 de = dictFind((dict*)ptrFromObj(o), field);
102 if (de == NULL) return NULL;
103 return (sds)dictGetVal(de);
104}
105
106/* Higher level function of hashTypeGet*() that returns the hash value
107 * associated with the specified field. If the field is found C_OK

Callers 4

hashTypeGetValueFunction · 0.85
hashTypeGetValueLengthFunction · 0.85
hashTypeExistsFunction · 0.85
addHashFieldToReplyFunction · 0.85

Calls 2

ptrFromObjFunction · 0.85
dictFindFunction · 0.70

Tested by

no test coverage detected