CpuUsage: code refactor

This commit is contained in:
李通洲
2023-04-15 10:23:32 +08:00
parent 8f2b3c6b69
commit e690d73434
+1 -2
View File
@@ -21,7 +21,7 @@ void ffPrintCPUUsage(FFinstance* instance)
{
ffPrintLogoAndKey(instance, FF_CPU_USAGE_MODULE_NAME, 0, &instance->config.cpuUsage.key);
FFstrbuf str;
FF_STRBUF_AUTO_DESTROY str;
ffStrbufInit(&str);
if(instance->config.percentType & FF_PERCENTAGE_TYPE_BAR_BIT)
ffAppendPercentBar(instance, &str, (uint8_t)percentage, 0, 5, 8);
@@ -32,7 +32,6 @@ void ffPrintCPUUsage(FFinstance* instance)
ffAppendPercentNum(instance, &str, (uint8_t) percentage, 50, 80, str.length > 0);
}
ffStrbufPutTo(&str, stdout);
ffStrbufDestroy(&str);
}
else
{