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

Function moduleInitKey

src/module.cpp:2299–2308  ·  view source on GitHub ↗

Initialize a RedisModuleKey struct */

Source from the content-addressed store, hash-verified

2297
2298/* Initialize a RedisModuleKey struct */
2299static void moduleInitKey(RedisModuleKey *kp, RedisModuleCtx *ctx, robj *keyname, robj *value, int mode){
2300 kp->ctx = ctx;
2301 kp->db = ctx->client->db;
2302 kp->key = keyname;
2303 incrRefCount(keyname);
2304 kp->value = value;
2305 kp->iter = NULL;
2306 kp->mode = mode;
2307 if (kp->value) moduleInitKeyTypeSpecific(kp);
2308}
2309
2310/* Initialize the type-specific part of the key. Only when key has a value. */
2311static void moduleInitKeyTypeSpecific(RedisModuleKey *key) {

Callers 2

RM_OpenKeyFunction · 0.85
moduleScanCallbackFunction · 0.85

Calls 2

incrRefCountFunction · 0.85

Tested by

no test coverage detected