summaryrefslogtreecommitdiff
path: root/src/dict.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2011-11-02 15:28:45 +0100
committerantirez <antirez@gmail.com>2011-11-02 15:28:45 +0100
commit6a7841eb099e8f92bb2c321e87e2b1f4724ddaed (patch)
treebcae4cc92c277cfe0c18c542bdda24fc25851a69 /src/dict.c
parentef23f3ac920c4cc1f403a2765455e455b03101bd (diff)
downloadredis-6a7841eb099e8f92bb2c321e87e2b1f4724ddaed.tar.gz
added an union in the dict.h structure to store 64 bit integers directly into hash table entries.
Diffstat (limited to 'src/dict.c')
-rw-r--r--src/dict.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/dict.c b/src/dict.c
index 24001fdd0..f98fdd0ee 100644
--- a/src/dict.c
+++ b/src/dict.c
@@ -270,7 +270,7 @@ int dictAdd(dict *d, void *key, void *val)
if ((index = _dictKeyIndex(d, key)) == -1)
return DICT_ERR;
- /* Allocates the memory and stores key */
+ /* Allocate the memory and store the new entry */
ht = dictIsRehashing(d) ? &d->ht[1] : &d->ht[0];
entry = zmalloc(sizeof(*entry));
entry->next = ht->table[index];
@@ -297,7 +297,6 @@ int dictReplace(dict *d, void *key, void *val)
return 1;
/* It already exists, get the entry */
entry = dictFind(d, key);
- /* Free the old value and set the new one */
/* Set the new value and free the old one. Note that it is important
* to do that in this order, as the value may just be exactly the same
* as the previous one. In this context, think to reference counting,