From: Florian Forster Date: Thu, 9 Nov 2017 15:12:10 +0000 (+0100) Subject: varnish plugin: Avoid unused variable even harder. X-Git-Tag: collectd-5.8.0~14^2~1 X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=8192bfcf975ff6275505c99193a23e2a066927d0 varnish plugin: Avoid unused variable even harder. ;-) --- diff --git a/src/varnish.c b/src/varnish.c index ebc8e7aa..d105b025 100644 --- a/src/varnish.c +++ b/src/varnish.c @@ -160,22 +160,15 @@ static int varnish_monitor(void *priv, name = namebuff; #elif HAVE_VARNISH_V4 - const char *class; - - class = pt->section->fantom->type; - name = pt->desc->name; - - if (strcmp(class, "MAIN") != 0) + if (strcmp(pt->section->fantom->type, "MAIN") != 0) return 0; + name = pt->desc->name; #elif HAVE_VARNISH_V3 - const char *class; + if (strcmp(pt->class, "") != 0) + return 0; - class = pt->class; name = pt->name; - - if (strcmp(class, "") != 0) - return 0; #endif val = *(const volatile uint64_t *)pt->ptr;