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

Function RM_DictReplaceC

app/redis-6.2.6/src/module.c:6694–6697  ·  view source on GitHub ↗

Like RedisModule_DictSetC() but will replace the key with the new * value if the key already exists. */

Source from the content-addressed store, hash-verified

6692/* Like RedisModule_DictSetC() but will replace the key with the new
6693 * value if the key already exists. */
6694int RM_DictReplaceC(RedisModuleDict *d, void *key, size_t keylen, void *ptr) {
6695 int retval = raxInsert(d->rax,key,keylen,ptr,NULL);
6696 return (retval == 1) ? REDISMODULE_OK : REDISMODULE_ERR;
6697}
6698
6699/* Like RedisModule_DictSetC() but takes the key as a RedisModuleString. */
6700int RM_DictSet(RedisModuleDict *d, RedisModuleString *key, void *ptr) {

Callers 1

RM_DictReplaceFunction · 0.85

Calls 1

raxInsertFunction · 0.85

Tested by

no test coverage detected