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

Function RM_DictSetC

app/redis-6.2.6/src/module.c:6687–6690  ·  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

6685 * already exist, REDISMODULE_OK is returned. Otherwise if the key already
6686 * exists the function returns REDISMODULE_ERR. */
6687int RM_DictSetC(RedisModuleDict *d, void *key, size_t keylen, void *ptr) {
6688 int retval = raxTryInsert(d->rax,key,keylen,ptr,NULL);
6689 return (retval == 1) ? REDISMODULE_OK : REDISMODULE_ERR;
6690}
6691
6692/* Like RedisModule_DictSetC() but will replace the key with the new
6693 * value if the key already exists. */

Callers 1

RM_DictSetFunction · 0.85

Calls 1

raxTryInsertFunction · 0.85

Tested by

no test coverage detected