mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 17:10:50 +00:00
fix dict get on not found
This commit is contained in:
parent
08c26591e3
commit
86fb7b20bf
@ -4419,7 +4419,7 @@ int RM_DictReplace(RedisModuleDict *d, RedisModuleString *key, void *ptr) {
|
|||||||
void *RM_DictGetC(RedisModuleDict *d, void *key, size_t keylen, int *nokey) {
|
void *RM_DictGetC(RedisModuleDict *d, void *key, size_t keylen, int *nokey) {
|
||||||
void *res = raxFind(d->rax,key,keylen);
|
void *res = raxFind(d->rax,key,keylen);
|
||||||
if (nokey) *nokey = (res == raxNotFound);
|
if (nokey) *nokey = (res == raxNotFound);
|
||||||
return res;
|
return (res == raxNotFound) ? NULL : res;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Like RedisModule_DictGetC() but takes the key as a RedisModuleString. */
|
/* Like RedisModule_DictGetC() but takes the key as a RedisModuleString. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user