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
d21d6b66
Commit
d21d6b66
authored
Feb 28, 2013
by
antirez
Browse files
Cluster: use node->numslots instead of popcount() where possible.
parent
4521115b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
d21d6b66
...
...
@@ -1110,8 +1110,7 @@ void clusterSendPing(clusterLink *link, int type) {
*/
if (this == server.cluster->myself ||
this->flags & (REDIS_NODE_HANDSHAKE|REDIS_NODE_NOADDR) ||
(
this
->
link
==
NULL
&&
popcount
(
this
->
slots
,
sizeof
(
this
->
slots
))
==
0
))
(this->link == NULL && this->numslots == 0))
{
freshnodes--; /* otherwise we may loop forever. */
continue;
...
...
@@ -1418,8 +1417,7 @@ void clusterUpdateState(void) {
while((de = dictNext(di)) != NULL) {
clusterNode *node = dictGetVal(de);
if
(
node
->
flags
&
REDIS_NODE_MASTER
&&
popcount
(
node
->
slots
,
sizeof
(
node
->
slots
)))
if (node->flags & REDIS_NODE_MASTER && node->numslots)
server.cluster->size++;
}
dictReleaseIterator(di);
...
...
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