diff options
author | Benny Baumann <BenBE@geshi.org> | 2023-05-09 15:05:16 +0200 |
---|---|---|
committer | Benny Baumann <BenBE@geshi.org> | 2023-05-09 15:19:36 +0200 |
commit | e05a203b9d7832d9a0f244676dba266bee2580d0 (patch) | |
tree | cf1b2ef21816518e20db996164bbc06fa5c3eea3 /freebsd | |
parent | 508d9ce5dcda45a33bd31d49cab19566c9cdcc89 (diff) |
Shorten CPUData ptr initialization stanza
Diffstat (limited to 'freebsd')
-rw-r--r-- | freebsd/Platform.c | 9 |
1 files changed, 2 insertions, 7 deletions
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; |