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