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

Function setTypeRemove

src/t_set.cpp:91–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91int setTypeRemove(robj *setobj, const char *value) {
92 long long llval;
93 if (setobj->encoding == OBJ_ENCODING_HT) {
94 if (dictDelete((dict*)setobj->m_ptr,value) == DICT_OK) {
95 if (htNeedsResize((dict*)setobj->m_ptr)) dictResize((dict*)setobj->m_ptr);
96 return 1;
97 }
98 } else if (setobj->encoding == OBJ_ENCODING_INTSET) {
99 if (isSdsRepresentableAsLongLong(value,&llval) == C_OK) {
100 int success;
101 setobj->m_ptr = intsetRemove((intset*)setobj->m_ptr,llval,&success);
102 if (success) return 1;
103 }
104 } else {
105 serverPanic("Unknown set encoding");
106 }
107 return 0;
108}
109
110int setTypeIsMember(robj_roptr subject, const char *value) {
111 long long llval;

Callers 6

activeExpireCycleExpireFunction · 0.85
sremCommandFunction · 0.85
smoveCommandFunction · 0.85
spopWithCountCommandFunction · 0.85
spopCommandFunction · 0.85
sunionDiffGenericCommandFunction · 0.85

Calls 5

htNeedsResizeFunction · 0.85
dictResizeFunction · 0.85
intsetRemoveFunction · 0.85
dictDeleteFunction · 0.70

Tested by

no test coverage detected