Skip to content

Commit e3cf99e

Browse files
committed
Simplify logic
Signed-off-by: Arthur Chan <[email protected]>
1 parent 1046191 commit e3cf99e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

experiment/textcov.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,7 @@ def subtract_covered_lines(self, other: Function, language: str = 'c++'):
127127
"""Subtract covered lines."""
128128

129129
if language == 'jvm':
130-
for line_no in self.lines:
131-
line = self.lines[line_no]
130+
for line_no, line in self.lines.items():
132131
other_line = other.lines.get(line_no)
133132
if other_line and other_line.hit_count > 0:
134133
self.lines[line_no].hit_count = 0
@@ -396,7 +395,7 @@ class name specification use single upper case letter for
396395
if c == 'L':
397396
start = True
398397
if next_arg:
399-
next_arg = f'{next_arg}{"[]" * array_count}'
398+
next_arg += '[]' * array_count
400399
array_count = 0
401400
args.append(next_arg)
402401
arg = ''
@@ -406,12 +405,12 @@ class name specification use single upper case letter for
406405
else:
407406
if c in JVM_CLASS_MAPPING:
408407
if next_arg:
409-
next_arg = f'{next_arg}{"[]" * array_count}'
408+
next_arg += '[]' * array_count
410409
array_count = 0
411410
args.append(next_arg)
412411
next_arg = JVM_CLASS_MAPPING[c]
413412

414413
if next_arg:
415-
next_arg = f'{next_arg}{"[]" * array_count}'
414+
next_arg += '[]' * array_count
416415
args.append(next_arg)
417416
return args

0 commit comments

Comments
 (0)