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
66144337
Commit
66144337
authored
Mar 13, 2013
by
antirez
Browse files
Cluster: use 'else if' for mutually exclusive conditionals.
parent
db7c17e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
66144337
...
@@ -781,14 +781,12 @@ int clusterProcessPacket(clusterLink *link) {
...
@@ -781,14 +781,12 @@ int clusterProcessPacket(clusterLink *link) {
explen
=
sizeof
(
clusterMsg
)
-
sizeof
(
union
clusterMsgData
);
explen
=
sizeof
(
clusterMsg
)
-
sizeof
(
union
clusterMsgData
);
explen
+=
(
sizeof
(
clusterMsgDataGossip
)
*
count
);
explen
+=
(
sizeof
(
clusterMsgDataGossip
)
*
count
);
if
(
totlen
!=
explen
)
return
1
;
if
(
totlen
!=
explen
)
return
1
;
}
}
else
if
(
type
==
CLUSTERMSG_TYPE_FAIL
)
{
if
(
type
==
CLUSTERMSG_TYPE_FAIL
)
{
uint32_t
explen
=
sizeof
(
clusterMsg
)
-
sizeof
(
union
clusterMsgData
);
uint32_t
explen
=
sizeof
(
clusterMsg
)
-
sizeof
(
union
clusterMsgData
);
explen
+=
sizeof
(
clusterMsgDataFail
);
explen
+=
sizeof
(
clusterMsgDataFail
);
if
(
totlen
!=
explen
)
return
1
;
if
(
totlen
!=
explen
)
return
1
;
}
}
else
if
(
type
==
CLUSTERMSG_TYPE_PUBLISH
)
{
if
(
type
==
CLUSTERMSG_TYPE_PUBLISH
)
{
uint32_t
explen
=
sizeof
(
clusterMsg
)
-
sizeof
(
union
clusterMsgData
);
uint32_t
explen
=
sizeof
(
clusterMsg
)
-
sizeof
(
union
clusterMsgData
);
explen
+=
sizeof
(
clusterMsgDataPublish
)
+
explen
+=
sizeof
(
clusterMsgDataPublish
)
+
...
...
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