From 23797e730ef79408deb055afb48e6470824f31d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Fri, 12 Mar 2021 17:43:23 +0100 Subject: CPUMeter_init: compactify branches --- CPUMeter.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'CPUMeter.c') diff --git a/CPUMeter.c b/CPUMeter.c index 99f19df1..b9bc67fc 100644 --- a/CPUMeter.c +++ b/CPUMeter.c @@ -41,13 +41,13 @@ typedef struct CPUMeterData_ { static void CPUMeter_init(Meter* this) { int cpu = this->param; - if (this->pl->cpuCount > 1) { + if (cpu == 0) { + Meter_setCaption(this, "Avg"); + } else if (this->pl->cpuCount > 1) { char caption[10]; xSnprintf(caption, sizeof(caption), "%3d", Settings_cpuId(this->pl->settings, cpu - 1)); Meter_setCaption(this, caption); } - if (this->param == 0) - Meter_setCaption(this, "Avg"); } static void CPUMeter_updateValues(Meter* this) { -- cgit v1.2.3