Cluster: use 'else if' for mutually exclusive conditionals.

This commit is contained in:
antirez 2013-03-13 17:27:06 +01:00
parent db7c17e969
commit 66144337bf

View File

@ -781,14 +781,12 @@ int clusterProcessPacket(clusterLink *link) {
explen = sizeof(clusterMsg)-sizeof(union clusterMsgData);
explen += (sizeof(clusterMsgDataGossip)*count);
if (totlen != explen) return 1;
}
if (type == CLUSTERMSG_TYPE_FAIL) {
} else if (type == CLUSTERMSG_TYPE_FAIL) {
uint32_t explen = sizeof(clusterMsg)-sizeof(union clusterMsgData);
explen += sizeof(clusterMsgDataFail);
if (totlen != explen) return 1;
}
if (type == CLUSTERMSG_TYPE_PUBLISH) {
} else if (type == CLUSTERMSG_TYPE_PUBLISH) {
uint32_t explen = sizeof(clusterMsg)-sizeof(union clusterMsgData);
explen += sizeof(clusterMsgDataPublish) +