Commit 9269c410 authored by Vitaly Arbuzov's avatar Vitaly Arbuzov
Browse files

Refactor dbIteratorNext

parent 6a10146f
......@@ -63,13 +63,8 @@ dict *dbIteratorNextDict(dbIterator *dbit) {
/* Returns next entry from the multi slot db. */
dictEntry *dbIteratorNext(dbIterator *dbit) {
if (!dbit->di.d) { /* No current dict, need to get a new one. */
dict *d = dbIteratorNextDict(dbit);
if (!d) return NULL;
dictInitSafeIterator(&dbit->di, d);
}
dictEntry *de = dictNext(&dbit->di);
if (!de) { /* Reached the end of the dictionary, check if there are more. */
dictEntry *de = dbit->di.d ? dictNext(&dbit->di) : NULL;
if (!de) { /* No current dict or reached the end of the dictionary. */
dict *d = dbIteratorNextDict(dbit);
if (!d) return NULL;
dictInitSafeIterator(&dbit->di, d);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment