From 66144337bfb924f1ad2e189cd562f2516b381f9a Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 13 Mar 2013 17:27:06 +0100 Subject: [PATCH] Cluster: use 'else if' for mutually exclusive conditionals. --- src/cluster.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/cluster.c b/src/cluster.c index ac44d5651..f037e6dc4 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -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) +