Skip to content

Commit bc059fc

Browse files
committed
Improve performance for Combine.combine
Create less intermediate objects.
1 parent 1e36da1 commit bc059fc

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/simplecov/combine/lines_combiner.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@ module LinesCombiner
1010
module_function
1111

1212
def combine(coverage_a, coverage_b)
13-
coverage_a
14-
.zip(coverage_b)
15-
.map do |coverage_a_val, coverage_b_val|
16-
merge_line_coverage(coverage_a_val, coverage_b_val)
17-
end
13+
coverage_a.map.with_index do |coverage_a_val, index|
14+
merge_line_coverage(coverage_a_val, coverage_b[index])
15+
end
1816
end
1917

2018
# Return depends on coverage in a specific line

0 commit comments

Comments
 (0)