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
eed189ff
Commit
eed189ff
authored
Mar 13, 2023
by
Vitaly Arbuzov
Browse files
Fix spacing issue and remove invalid comment
parent
f2805b2c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/db.c
View file @
eed189ff
...
@@ -55,7 +55,7 @@ dict *dbIteratorNextDict(dbIterator *dbit) {
...
@@ -55,7 +55,7 @@ dict *dbIteratorNextDict(dbIterator *dbit) {
if
(
!
server
.
cluster_enabled
)
{
if
(
!
server
.
cluster_enabled
)
{
dbit
->
cur_slot
=
dbit
->
index
++
?
-
1
:
0
;
dbit
->
cur_slot
=
dbit
->
index
++
?
-
1
:
0
;
}
else
if
(
intsetGet
(
dbit
->
db
->
non_empty_dicts
,
dbit
->
index
++
,
&
slot
)){
}
else
if
(
intsetGet
(
dbit
->
db
->
non_empty_dicts
,
dbit
->
index
++
,
&
slot
)){
dbit
->
cur_slot
=
(
int
)
slot
;
dbit
->
cur_slot
=
(
int
)
slot
;
return
dbit
->
db
->
dict
[
slot
];
return
dbit
->
db
->
dict
[
slot
];
}
}
return
dbit
->
cur_slot
>=
0
?
dbit
->
db
->
dict
[
dbit
->
cur_slot
]
:
NULL
;
return
dbit
->
cur_slot
>=
0
?
dbit
->
db
->
dict
[
dbit
->
cur_slot
]
:
NULL
;
...
@@ -377,7 +377,7 @@ robj *dbRandomKey(redisDb *db) {
...
@@ -377,7 +377,7 @@ robj *dbRandomKey(redisDb *db) {
robj
*
keyobj
;
robj
*
keyobj
;
dict
*
randomDict
=
getRandomDict
(
db
);
dict
*
randomDict
=
getRandomDict
(
db
);
de
=
dictGetFairRandomKey
(
randomDict
);
de
=
dictGetFairRandomKey
(
randomDict
);
if
(
de
==
NULL
)
return
NULL
;
// TODO consider other non-empty slot buckets.
if
(
de
==
NULL
)
return
NULL
;
key
=
dictGetKey
(
de
);
key
=
dictGetKey
(
de
);
keyobj
=
createStringObject
(
key
,
sdslen
(
key
));
keyobj
=
createStringObject
(
key
,
sdslen
(
key
));
...
...
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