From e617bf2ddc2106c2a94c3130f3bfb70500e190b8 Mon Sep 17 00:00:00 2001 From: Madelyn Olson Date: Mon, 7 Oct 2024 11:56:15 -0700 Subject: [PATCH] Removing incorrect comment about a warning (#1132) There is a lot of bad legacy usage of `default:` with enums, which is an anti-pattern. If you omit the default, the compiler will tell you if a new enum value was added and that it is missing from a switch statement. Someone mentioned on another PR they used `default:` because of this warning, so just removing it, but might create an issue to do a wider cleanup. Signed-off-by: Madelyn Olson --- src/cluster_legacy.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/cluster_legacy.c b/src/cluster_legacy.c index 120d55501c..14f8a6bd1e 100644 --- a/src/cluster_legacy.c +++ b/src/cluster_legacy.c @@ -227,12 +227,8 @@ static clusterNode *clusterNodeIterNext(ClusterNodeIterator *iter) { /* Return the value associated with the node, or NULL if no more nodes */ return ln ? listNodeValue(ln) : NULL; } - /* This line is unreachable but added to avoid compiler warnings */ - default: { - serverPanic("bad type"); - return NULL; - } } + serverPanic("Unknown iterator type %d", iter->type); } static void clusterNodeIterReset(ClusterNodeIterator *iter) {