Skip to content

Commit

Permalink
Stop unnecessary Float coercion
Browse files Browse the repository at this point in the history
  • Loading branch information
PragTob committed Jan 26, 2020
1 parent 0f27688 commit b3a8315
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/simplecov/coverage_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ def initialize(covered:, missed:, total_strength: 0.0)
def compute_percent(covered, total)
return 100.0 if total.zero?

Float(covered * 100.0 / total)
covered * 100.0 / total
end

def compute_strength(total_strength, total)
return 0.0 if total.zero?

Float(total_strength.to_f / total)
total_strength.to_f / total
end
end
end

0 comments on commit b3a8315

Please sign in to comment.