mirror of https://github.com/xzeldon/htop.git
CPUMeter_init: compactify branches
This commit is contained in:
parent
0cfc9b0980
commit
23797e730e
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue