diff --git a/experiment/textcov.py b/experiment/textcov.py index 84a32adf86..eff579399e 100644 --- a/experiment/textcov.py +++ b/experiment/textcov.py @@ -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 @@ -396,9 +395,8 @@ class name specification use single upper case letter for if c == 'L': start = True if next_arg: - if array_count > 0: - next_arg = f'{next_arg}{"[]" * array_count}' - array_count = 0 + next_arg += '[]' * array_count + array_count = 0 args.append(next_arg) arg = '' next_arg = '' @@ -407,14 +405,12 @@ class name specification use single upper case letter for else: if c in JVM_CLASS_MAPPING: if next_arg: - if array_count > 0: - next_arg = f'{next_arg}{"[]" * array_count}' - array_count = 0 + next_arg += '[]' * array_count + array_count = 0 args.append(next_arg) next_arg = JVM_CLASS_MAPPING[c] if next_arg: - if array_count > 0: - next_arg = f'{next_arg}{"[]" * array_count}' + next_arg += '[]' * array_count args.append(next_arg) return args