From e05a203b9d7832d9a0f244676dba266bee2580d0 Mon Sep 17 00:00:00 2001 From: Benny Baumann Date: Tue, 9 May 2023 15:05:16 +0200 Subject: Shorten CPUData ptr initialization stanza --- freebsd/Platform.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'freebsd') diff --git a/freebsd/Platform.c b/freebsd/Platform.c index a2dc072c..66e1463d 100644 --- a/freebsd/Platform.c +++ b/freebsd/Platform.c @@ -195,14 +195,9 @@ double Platform_setCPUValues(Meter* this, unsigned int cpu) { const Machine* host = this->host; const FreeBSDMachine* fhost = (const FreeBSDMachine*) host; unsigned int cpus = host->activeCPUs; - const CPUData* cpuData; - if (cpus == 1) { - // single CPU box has everything in fhost->cpus[0] - cpuData = &(fhost->cpus[0]); - } else { - cpuData = &(fhost->cpus[cpu]); - } + // single CPU box has everything in fhost->cpus[0] + const CPUData* cpuData = cpus == 1 ? &fhost->cpus[0] : &fhost->cpus[cpu]; double percent; double* v = this->values; -- cgit v1.2.3