Skip to content

Commit ea53833

Browse files
committed
Remove unnecessary checks for content->length
1 parent c491c11 commit ea53833

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/modules/cpu.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,17 @@
77
#define FF_CPU_NUM_FORMAT_ARGS 15
88

99

10-
static long parseLong(const FFstrbuf* content) {
10+
static long parseLong(const FFstrbuf* content)
11+
{
1112
long value;
12-
if(content->length == 0 || (sscanf(content->chars, "%li", &value) != 1))
13+
if(sscanf(content->chars, "%li", &value) != 1)
1314
return -1;
1415
return value;
1516

1617
}
1718

1819
static double parseHz(const FFstrbuf* content)
1920
{
20-
if(content->length == 0)
21-
return 0;
22-
2321
double herz;
2422
if(sscanf(content->chars, "%lf", &herz) != 1)
2523
return 0;
@@ -117,7 +115,8 @@ void ffPrintCPU(FFinstance* instance)
117115

118116
const FFTempsResult *temps = ffDetectTemps(&instance);
119117
double cpuTemp = 0.0/0.0;
120-
for(uint32_t i = 0; i< temps->values.length; i++) {
118+
for(uint32_t i = 0; i< temps->values.length; i++)
119+
{
121120
FFTempValue *v = ffListGet(&temps->values, i);
122121
if(ffStrbufFirstIndexS(&v->name, "cpu") == v->name.length
123122
&& ffStrbufCompS(&v->name, "k10temp") != 0

0 commit comments

Comments
 (0)