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

Function setTypeInitIterator

src/t_set.cpp:124–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124setTypeIterator *setTypeInitIterator(robj_roptr subject) {
125 setTypeIterator *si = (setTypeIterator*)zmalloc(sizeof(setTypeIterator), MALLOC_LOCAL);
126 si->subject = subject;
127 si->encoding = subject->encoding;
128 if (si->encoding == OBJ_ENCODING_HT) {
129 si->di = dictGetIterator((dict*)subject->m_ptr);
130 } else if (si->encoding == OBJ_ENCODING_INTSET) {
131 si->ii = 0;
132 } else {
133 serverPanic("Unknown set encoding");
134 }
135 return si;
136}
137
138void setTypeReleaseIterator(setTypeIterator *si) {
139 if (si->encoding == OBJ_ENCODING_HT)

Callers 8

sortCommandFunction · 0.85
setTypeConvertFunction · 0.85
setTypeDupFunction · 0.85
spopWithCountCommandFunction · 0.85
sinterGenericCommandFunction · 0.85
sunionDiffGenericCommandFunction · 0.85
xorObjectDigestFunction · 0.85

Calls 2

zmallocFunction · 0.85
dictGetIteratorFunction · 0.70

Tested by

no test coverage detected