Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
9269c410
Commit
9269c410
authored
Mar 21, 2023
by
Vitaly Arbuzov
Browse files
Refactor dbIteratorNext
parent
6a10146f
Changes
1
Show whitespace changes
Inline
Side-by-side
src/db.c
View file @
9269c410
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment