| 828 | } |
| 829 | |
| 830 | void hdelCommand(client *c) { |
| 831 | robj *o; |
| 832 | int j, deleted = 0, keyremoved = 0; |
| 833 | |
| 834 | if ((o = lookupKeyWriteOrReply(c,c->argv[1],shared.czero)) == NULL || |
| 835 | checkType(c,o,OBJ_HASH)) return; |
| 836 | |
| 837 | for (j = 2; j < c->argc; j++) { |
| 838 | if (hashTypeDelete(o,c->argv[j]->ptr)) { |
| 839 | deleted++; |
| 840 | if (hashTypeLength(o) == 0) { |
| 841 | dbDelete(c->db,c->argv[1]); |
| 842 | keyremoved = 1; |
| 843 | break; |
| 844 | } |
| 845 | } |
| 846 | } |
| 847 | if (deleted) { |
| 848 | signalModifiedKey(c,c->db,c->argv[1]); |
| 849 | notifyKeyspaceEvent(NOTIFY_HASH,"hdel",c->argv[1],c->db->id); |
| 850 | if (keyremoved) |
| 851 | notifyKeyspaceEvent(NOTIFY_GENERIC,"del",c->argv[1], |
| 852 | c->db->id); |
| 853 | server.dirty += deleted; |
| 854 | } |
| 855 | addReplyLongLong(c,deleted); |
| 856 | } |
| 857 | |
| 858 | void hlenCommand(client *c) { |
| 859 | robj *o; |
nothing calls this directly
no test coverage detected