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

Function RM_DictSetC

src/module.cpp:6879–6882  ·  view source on GitHub ↗

Store the specified key into the dictionary, setting its value to the * pointer 'ptr'. If the key was added with success, since it did not * already exist, REDISMODULE_OK is returned. Otherwise if the key already * exists the function returns REDISMODULE_ERR. */

Source from the content-addressed store, hash-verified

6877 * already exist, REDISMODULE_OK is returned. Otherwise if the key already
6878 * exists the function returns REDISMODULE_ERR. */
6879int RM_DictSetC(RedisModuleDict *d, void *key, size_t keylen, void *ptr) {
6880 int retval = raxTryInsert(d->rax,(unsigned char*)key,keylen,ptr,NULL);
6881 return (retval == 1) ? REDISMODULE_OK : REDISMODULE_ERR;
6882}
6883
6884/* Like RedisModule_DictSetC() but will replace the key with the new
6885 * value if the key already exists. */

Callers 1

RM_DictSetFunction · 0.85

Calls 1

raxTryInsertFunction · 0.85

Tested by

no test coverage detected