mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
Integrate NAN check into assignment
The check for NAN is kept to avoid relying on implementation details of the CLAMP macro/function
This commit is contained in:
@ -176,10 +176,7 @@ double Platform_setCPUValues(Meter* this, int cpu) {
|
||||
percent = v[0] + v[1] + v[2];
|
||||
}
|
||||
|
||||
percent = CLAMP(percent, 0.0, 100.0);
|
||||
if (isnan(percent)) {
|
||||
percent = 0.0;
|
||||
}
|
||||
percent = isnan(percent) ? 0.0 : CLAMP(percent, 0.0, 100.0);
|
||||
|
||||
v[CPU_METER_FREQUENCY] = NAN;
|
||||
|
||||
|
Reference in New Issue
Block a user