donate-cpu.py: Simplify check if line is not empty

In Python an empty string returns False in a conditional check. No need to calculate lenght or compare it with an empty string.
This commit is contained in:
versat 2019-02-04 11:25:29 +01:00
parent 360ba33e4c
commit dcff026da0
1 changed files with 4 additions and 5 deletions

View File

@ -263,11 +263,10 @@ def scanPackage(workPath, cppcheckPath, jobs):
for line in stderr.split('\n'):
if ': information: ' in line:
information_messages += line + '\n'
else:
if len(line) > 0:
issue_messages += line + '\n'
if re.match(r'.*:[0-9]+:.*\]$', line):
count += 1
elif line:
issue_messages += line + '\n'
if re.match(r'.*:[0-9]+:.*\]$', line):
count += 1
print('Number of issues: ' + str(count))
return count, issue_messages, information_messages, elapsedTime, options