MCPcopy Create free account
hub / github.com/F-Stack/f-stack / hsetnxCommand

Function hsetnxCommand

app/redis-6.2.6/src/t_hash.c:643–657  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

641 *----------------------------------------------------------------------------*/
642
643void hsetnxCommand(client *c) {
644 robj *o;
645 if ((o = hashTypeLookupWriteOrCreate(c,c->argv[1])) == NULL) return;
646 hashTypeTryConversion(o,c->argv,2,3);
647
648 if (hashTypeExists(o, c->argv[2]->ptr)) {
649 addReply(c, shared.czero);
650 } else {
651 hashTypeSet(o,c->argv[2]->ptr,c->argv[3]->ptr,HASH_SET_COPY);
652 addReply(c, shared.cone);
653 signalModifiedKey(c,c->db,c->argv[1]);
654 notifyKeyspaceEvent(NOTIFY_HASH,"hset",c->argv[1],c->db->id);
655 server.dirty++;
656 }
657}
658
659void hsetCommand(client *c) {
660 int i, created = 0;

Callers

nothing calls this directly

Calls 7

hashTypeTryConversionFunction · 0.85
hashTypeExistsFunction · 0.85
addReplyFunction · 0.85
hashTypeSetFunction · 0.85
signalModifiedKeyFunction · 0.85
notifyKeyspaceEventFunction · 0.85

Tested by

no test coverage detected