Skip to content

Commit

Permalink
Simplify logic
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Chan <[email protected]>
  • Loading branch information
arthurscchan committed Jul 18, 2024
1 parent 1046191 commit e3cf99e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions experiment/textcov.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ def subtract_covered_lines(self, other: Function, language: str = 'c++'):
"""Subtract covered lines."""

if language == 'jvm':
for line_no in self.lines:
line = self.lines[line_no]
for line_no, line in self.lines.items():
other_line = other.lines.get(line_no)
if other_line and other_line.hit_count > 0:
self.lines[line_no].hit_count = 0
Expand Down Expand Up @@ -396,7 +395,7 @@ class name specification use single upper case letter for
if c == 'L':
start = True
if next_arg:
next_arg = f'{next_arg}{"[]" * array_count}'
next_arg += '[]' * array_count
array_count = 0
args.append(next_arg)
arg = ''
Expand All @@ -406,12 +405,12 @@ class name specification use single upper case letter for
else:
if c in JVM_CLASS_MAPPING:
if next_arg:
next_arg = f'{next_arg}{"[]" * array_count}'
next_arg += '[]' * array_count
array_count = 0
args.append(next_arg)
next_arg = JVM_CLASS_MAPPING[c]

if next_arg:
next_arg = f'{next_arg}{"[]" * array_count}'
next_arg += '[]' * array_count
args.append(next_arg)
return args

0 comments on commit e3cf99e

Please sign in to comment.