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

Function zmscoreCommand

src/t_zset.cpp:3745–3760  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3743}
3744
3745void zmscoreCommand(client *c) {
3746 robj *key = c->argv[1];
3747 double score;
3748 robj_roptr zobj = lookupKeyRead(c->db,key);
3749 if (checkType(c,zobj,OBJ_ZSET)) return;
3750
3751 addReplyArrayLen(c,c->argc - 2);
3752 for (int j = 2; j < c->argc; j++) {
3753 /* Treat a missing set the same way as an empty set */
3754 if (zobj == nullptr || zsetScore(zobj,(sds)ptrFromObj(c->argv[j]),&score) == C_ERR) {
3755 addReplyNull(c);
3756 } else {
3757 addReplyDouble(c,score);
3758 }
3759 }
3760}
3761
3762void zrankGenericCommand(client *c, int reverse) {
3763 robj *key = c->argv[1];

Callers

nothing calls this directly

Calls 7

lookupKeyReadFunction · 0.85
checkTypeFunction · 0.85
addReplyArrayLenFunction · 0.85
zsetScoreFunction · 0.85
ptrFromObjFunction · 0.85
addReplyNullFunction · 0.85
addReplyDoubleFunction · 0.85

Tested by

no test coverage detected