[master] 03fe53475 param: Remove unncessary else branch

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Tue Nov 21 06:03:09 UTC 2023


commit 03fe53475d85a375e8f6f4dee6ad46d030300415
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Tue Nov 7 07:49:30 2023 +0100

    param: Remove unncessary else branch
    
    Better diff with the --ignore-all-space option.

diff --git a/bin/varnishd/mgt/mgt_param_tweak.c b/bin/varnishd/mgt/mgt_param_tweak.c
index 0a8e1e595..f1ac4d4b5 100644
--- a/bin/varnishd/mgt/mgt_param_tweak.c
+++ b/bin/varnishd/mgt/mgt_param_tweak.c
@@ -685,23 +685,22 @@ tweak_generic_bits(struct vsb *vsb, const struct parspec *par, const char *arg,
 		    desc, sign));
 	}
 
-	if (arg != NULL && arg != JSON_FMT) {
+	if (arg != NULL && arg != JSON_FMT)
 		return (bit_tweak(vsb, p, l, arg, tags, desc, sign));
-	} else {
-		if (arg == JSON_FMT)
-			VSB_putc(vsb, '"');
-		s = "";
-		for (j = 0; j < l; j++) {
-			if (bit(p, j, BTST)) {
-				VSB_printf(vsb, "%s%c%s", s, sign, tags[j]);
-				s = ",";
-			}
+
+	if (arg == JSON_FMT)
+		VSB_putc(vsb, '"');
+	s = "";
+	for (j = 0; j < l; j++) {
+		if (bit(p, j, BTST)) {
+			VSB_printf(vsb, "%s%c%s", s, sign, tags[j]);
+			s = ",";
 		}
-		if (*s == '\0')
-			VSB_cat(vsb, sign == '+' ? "none" : "all");
-		if (arg == JSON_FMT)
-			VSB_putc(vsb, '"');
 	}
+	if (*s == '\0')
+		VSB_cat(vsb, sign == '+' ? "none" : "all");
+	if (arg == JSON_FMT)
+		VSB_putc(vsb, '"');
 	return (0);
 }
 


More information about the varnish-commit mailing list