Skip to content

Commit

Permalink
Re-style conditional assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
sinsoku committed Feb 11, 2016
1 parent 39b50dc commit a45f7d3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/simplecov/merge_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ def merge_resultset(array)
new_array = dup
array.each_with_index do |element, i|
pair = [element, new_array[i]]
if pair.any?(&:nil?) && pair.map(&:to_i).all?(&:zero?)
new_array[i] = nil
else
new_array[i] = element.to_i + new_array[i].to_i
end
new_array[i] = if pair.any?(&:nil?) && pair.map(&:to_i).all?(&:zero?)
nil
else
element.to_i + new_array[i].to_i
end
end
new_array
end
Expand Down

0 comments on commit a45f7d3

Please sign in to comment.