summaryrefslogtreecommitdiff
path: root/src/defrag.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/defrag.c')
-rw-r--r--src/defrag.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/defrag.c b/src/defrag.c
index 15230b5d2..5d18c9079 100644
--- a/src/defrag.c
+++ b/src/defrag.c
@@ -134,7 +134,6 @@ long dictIterDefragEntry(dictIterator *iter) {
* of the dict and it's iterator, but the benefit is that it is very easy
* to use, and require no other changes in the dict. */
long defragged = 0;
- dictht *ht;
/* Handle the next entry (if there is one), and update the pointer in the
* current entry. */
if (iter->nextEntry) {
@@ -146,12 +145,11 @@ long dictIterDefragEntry(dictIterator *iter) {
}
}
/* handle the case of the first entry in the hash bucket. */
- ht = &iter->d->ht[iter->table];
- if (ht->table[iter->index] == iter->entry) {
+ if (iter->d->ht_table[iter->table][iter->index] == iter->entry) {
dictEntry *newde = activeDefragAlloc(iter->entry);
if (newde) {
iter->entry = newde;
- ht->table[iter->index] = newde;
+ iter->d->ht_table[iter->table][iter->index] = newde;
defragged++;
}
}
@@ -165,14 +163,14 @@ long dictDefragTables(dict* d) {
dictEntry **newtable;
long defragged = 0;
/* handle the first hash table */
- newtable = activeDefragAlloc(d->ht[0].table);
+ newtable = activeDefragAlloc(d->ht_table[0]);
if (newtable)
- defragged++, d->ht[0].table = newtable;
+ defragged++, d->ht_table[0] = newtable;
/* handle the second hash table */
- if (d->ht[1].table) {
- newtable = activeDefragAlloc(d->ht[1].table);
+ if (d->ht_table[1]) {
+ newtable = activeDefragAlloc(d->ht_table[1]);
if (newtable)
- defragged++, d->ht[1].table = newtable;
+ defragged++, d->ht_table[1] = newtable;
}
return defragged;
}