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

Function setTypeIsMember

src/t_set.cpp:110–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108}
109
110int setTypeIsMember(robj_roptr subject, const char *value) {
111 long long llval;
112 if (subject->encoding == OBJ_ENCODING_HT) {
113 return dictFind((dict*)subject->m_ptr,value) != NULL;
114 } else if (subject->encoding == OBJ_ENCODING_INTSET) {
115 if (isSdsRepresentableAsLongLong(value,&llval) == C_OK) {
116 return intsetFind((intset*)subject->m_ptr,llval);
117 }
118 } else {
119 serverPanic("Unknown set encoding");
120 }
121 return 0;
122}
123
124setTypeIterator *setTypeInitIterator(robj_roptr subject) {
125 setTypeIterator *si = (setTypeIterator*)zmalloc(sizeof(setTypeIterator), MALLOC_LOCAL);

Callers 6

expireMemberCoreFunction · 0.85
smoveCommandFunction · 0.85
sismemberCommandFunction · 0.85
smismemberCommandFunction · 0.85
sinterGenericCommandFunction · 0.85
sunionDiffGenericCommandFunction · 0.85

Calls 3

intsetFindFunction · 0.85
dictFindFunction · 0.70

Tested by

no test coverage detected