Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
86fb7b20
Commit
86fb7b20
authored
Oct 01, 2018
by
Hamid Alaei
Browse files
fix dict get on not found
parent
08c26591
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/module.c
View file @
86fb7b20
...
@@ -4419,7 +4419,7 @@ int RM_DictReplace(RedisModuleDict *d, RedisModuleString *key, void *ptr) {
...
@@ -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. */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment