summaryrefslogtreecommitdiff
path: root/dict.c
diff options
context:
space:
mode:
authorsundb <sundbcn@gmail.com>2021-12-16 17:42:58 +0800
committerGitHub <noreply@github.com>2021-12-16 17:42:58 +0800
commitc6657ef65bacc989a5ae1462062d41547fa84765 (patch)
tree859dfe063b7755339425c9ebbab3bdc55b4bf95f /dict.c
parentfd033e983acb69f7814255e7836f255411e17007 (diff)
parentda5a4ff3622e8744b772a76f6ce580dc9134fb38 (diff)
Merge branch 'redis:master' into master
Diffstat (limited to 'dict.c')
-rw-r--r--dict.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/dict.c b/dict.c
index 34a33ea..ad57181 100644
--- a/dict.c
+++ b/dict.c
@@ -267,16 +267,11 @@ static dictEntry *dictFind(dict *ht, const void *key) {
return NULL;
}
-static dictIterator *dictGetIterator(dict *ht) {
- dictIterator *iter = hi_malloc(sizeof(*iter));
- if (iter == NULL)
- return NULL;
-
+static void dictInitIterator(dictIterator *iter, dict *ht) {
iter->ht = ht;
iter->index = -1;
iter->entry = NULL;
iter->nextEntry = NULL;
- return iter;
}
static dictEntry *dictNext(dictIterator *iter) {
@@ -299,10 +294,6 @@ static dictEntry *dictNext(dictIterator *iter) {
return NULL;
}
-static void dictReleaseIterator(dictIterator *iter) {
- hi_free(iter);
-}
-
/* ------------------------- private functions ------------------------------ */
/* Expand the hash table if needed */