| 324 | } |
| 325 | |
| 326 | void sremCommand(client *c) { |
| 327 | robj *set; |
| 328 | int j, deleted = 0, keyremoved = 0; |
| 329 | |
| 330 | if ((set = lookupKeyWriteOrReply(c,c->argv[1],shared.czero)) == NULL || |
| 331 | checkType(c,set,OBJ_SET)) return; |
| 332 | |
| 333 | for (j = 2; j < c->argc; j++) { |
| 334 | if (setTypeRemove(set,c->argv[j]->ptr)) { |
| 335 | deleted++; |
| 336 | if (setTypeSize(set) == 0) { |
| 337 | dbDelete(c->db,c->argv[1]); |
| 338 | keyremoved = 1; |
| 339 | break; |
| 340 | } |
| 341 | } |
| 342 | } |
| 343 | if (deleted) { |
| 344 | signalModifiedKey(c,c->db,c->argv[1]); |
| 345 | notifyKeyspaceEvent(NOTIFY_SET,"srem",c->argv[1],c->db->id); |
| 346 | if (keyremoved) |
| 347 | notifyKeyspaceEvent(NOTIFY_GENERIC,"del",c->argv[1], |
| 348 | c->db->id); |
| 349 | server.dirty += deleted; |
| 350 | } |
| 351 | addReplyLongLong(c,deleted); |
| 352 | } |
| 353 | |
| 354 | void smoveCommand(client *c) { |
| 355 | robj *srcset, *dstset, *ele; |
nothing calls this directly
no test coverage detected