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

Function hashTypeCurrentFromHashTable

src/t_hash.cpp:409–417  ·  view source on GitHub ↗

Get the field or value at iterator cursor, for an iterator on a hash value * encoded as a hash table. Prototype is similar to * `hashTypeGetFromHashTable`. */

Source from the content-addressed store, hash-verified

407 * encoded as a hash table. Prototype is similar to
408 * `hashTypeGetFromHashTable`. */
409sds hashTypeCurrentFromHashTable(hashTypeIterator *hi, int what) {
410 serverAssert(hi->encoding == OBJ_ENCODING_HT);
411
412 if (what & OBJ_HASH_KEY) {
413 return (sds)dictGetKey(hi->de);
414 } else {
415 return (sds)dictGetVal(hi->de);
416 }
417}
418
419/* Higher level function of hashTypeCurrent*() that returns the hash value
420 * at current iterator position.

Callers 4

hashTypeCurrentObjectFunction · 0.85
hashTypeDupFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected