module SimpleCov::Combine::BranchesCombiner
def combine(coverage_a, coverage_b)
-
(Hash)-
def combine(coverage_a, coverage_b) merged = {} #: Hash[untyped, [untyped, Hash[untyped, untyped]]] combined = [coverage_a, coverage_b].each_with_object(merged) do |coverage, memo| coverage.each do |condition, branches_inside| condition_key = tuple_identity(condition) condition_tuple, merged_branches = memo[condition_key] ||= [condition, {}] merge_branches(merged_branches, branches_inside) memo[condition_key] = [condition_tuple, merged_branches] end end combined.values.to_h { |condition, branches| [condition, branches.values.to_h] } end