Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
f491eee2
Unverified
Commit
f491eee2
authored
Mar 08, 2021
by
Huang Zhw
Committed by
GitHub
Mar 07, 2021
Browse files
Cleanup: dictEncObjHash remove redundant conditional statement (#8488)
parent
e8e6ca63
Changes
1
Show whitespace changes
Inline
Side-by-side
src/server.c
View file @
f491eee2
...
@@ -1332,21 +1332,14 @@ uint64_t dictEncObjHash(const void *key) {
...
@@ -1332,21 +1332,14 @@ uint64_t dictEncObjHash(const void *key) {
if
(
sdsEncodedObject
(
o
))
{
if
(
sdsEncodedObject
(
o
))
{
return
dictGenHashFunction
(
o
->
ptr
,
sdslen
((
sds
)
o
->
ptr
));
return
dictGenHashFunction
(
o
->
ptr
,
sdslen
((
sds
)
o
->
ptr
));
}
else
{
}
else
if
(
o
->
encoding
==
OBJ_ENCODING_INT
)
{
if
(
o
->
encoding
==
OBJ_ENCODING_INT
)
{
char
buf
[
32
];
char
buf
[
32
];
int
len
;
int
len
;
len
=
ll2string
(
buf
,
32
,(
long
)
o
->
ptr
);
len
=
ll2string
(
buf
,
32
,(
long
)
o
->
ptr
);
return
dictGenHashFunction
((
unsigned
char
*
)
buf
,
len
);
return
dictGenHashFunction
((
unsigned
char
*
)
buf
,
len
);
}
else
{
}
else
{
uint64_t
hash
;
serverPanic
(
"Unknown string encoding"
);
o
=
getDecodedObject
(
o
);
hash
=
dictGenHashFunction
(
o
->
ptr
,
sdslen
((
sds
)
o
->
ptr
));
decrRefCount
(
o
);
return
hash
;
}
}
}
}
}
...
...
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