mirror of
https://github.com/fluencelabs/redis
synced 2025-06-23 14:01:34 +00:00
dict.c: dictReplaceRaw() -> dictAddOrFind().
What they say about "naming things" in programming?
This commit is contained in:
@ -395,13 +395,13 @@ int dictReplace(dict *d, void *key, void *val)
|
||||
}
|
||||
|
||||
/* Add or Find:
|
||||
* dictReplaceRaw() is simply a version of dictAddRaw() that always
|
||||
* dictAddOrFind() is simply a version of dictAddRaw() that always
|
||||
* returns the hash entry of the specified key, even if the key already
|
||||
* exists and can't be added (in that case the entry of the already
|
||||
* existing key is returned.)
|
||||
*
|
||||
* See dictAddRaw() for more information. */
|
||||
dictEntry *dictReplaceRaw(dict *d, void *key) {
|
||||
dictEntry *dictAddOrFind(dict *d, void *key) {
|
||||
dictEntry *entry, *existing;
|
||||
entry = dictAddRaw(d,key,&existing);
|
||||
return entry ? entry : existing;
|
||||
|
Reference in New Issue
Block a user