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

Function hashTypeInitIterator

src/t_hash.cpp:327–341  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

325}
326
327hashTypeIterator *hashTypeInitIterator(robj_roptr subject) {
328 hashTypeIterator *hi = (hashTypeIterator*)zmalloc(sizeof(hashTypeIterator), MALLOC_LOCAL);
329 hi->subject = subject;
330 hi->encoding = subject->encoding;
331
332 if (hi->encoding == OBJ_ENCODING_ZIPLIST) {
333 hi->fptr = NULL;
334 hi->vptr = NULL;
335 } else if (hi->encoding == OBJ_ENCODING_HT) {
336 hi->di = dictGetIterator((dict*)subject->m_ptr);
337 } else {
338 serverPanic("Unknown hash encoding");
339 }
340 return hi;
341}
342
343void hashTypeReleaseIterator(hashTypeIterator *hi) {
344 if (hi->encoding == OBJ_ENCODING_HT)

Callers 6

hashTypeConvertZiplistFunction · 0.85
hashTypeDupFunction · 0.85
genericHgetallCommandFunction · 0.85
xorObjectDigestFunction · 0.85
rewriteHashObjectFunction · 0.85

Calls 2

zmallocFunction · 0.85
dictGetIteratorFunction · 0.70

Tested by

no test coverage detected