mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
CPUUsage: skip NaN when summarizing values
This commit is contained in:
@@ -25,16 +25,19 @@ void ffPrintCPUUsage(FFCPUUsageOptions* options)
|
||||
uint32_t index = 0;
|
||||
FF_LIST_FOR_EACH(double, percent, percentages)
|
||||
{
|
||||
sumValue += *percent;
|
||||
if (*percent > maxValue)
|
||||
if (*percent == *percent)
|
||||
{
|
||||
maxValue = *percent;
|
||||
maxIndex = index;
|
||||
}
|
||||
if (*percent < minValue)
|
||||
{
|
||||
minValue = *percent;
|
||||
minIndex = index;
|
||||
sumValue += *percent;
|
||||
if (*percent > maxValue)
|
||||
{
|
||||
maxValue = *percent;
|
||||
maxIndex = index;
|
||||
}
|
||||
if (*percent < minValue)
|
||||
{
|
||||
minValue = *percent;
|
||||
minIndex = index;
|
||||
}
|
||||
}
|
||||
++index;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user