aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2017-06-04 20:17:12 +0930
committerGitHub <noreply@github.com>2017-06-04 20:17:12 +0930
commit51abe8fe6ea997ad879eb5a19842144047268117 (patch)
tree6a63c7a82cd78ed408406614c54bf4bdb93f83b2
parent04b15abd0a6d70fae3cf656975346611ade77ae6 (diff)
parent3168da0af75bd05082be4909deaa1e3eb1e78e27 (diff)
downloadrails-51abe8fe6ea997ad879eb5a19842144047268117.tar.gz
rails-51abe8fe6ea997ad879eb5a19842144047268117.tar.bz2
rails-51abe8fe6ea997ad879eb5a19842144047268117.zip
Merge pull request #29351 from vipulnsward/unnecessary-assignment
Don't create extra assignment, just return
-rw-r--r--activesupport/lib/active_support/number_helper/rounding_helper.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/number_helper/rounding_helper.rb b/activesupport/lib/active_support/number_helper/rounding_helper.rb
index d9644df17d..63b48444a6 100644
--- a/activesupport/lib/active_support/number_helper/rounding_helper.rb
+++ b/activesupport/lib/active_support/number_helper/rounding_helper.rb
@@ -40,11 +40,11 @@ module ActiveSupport
def convert_to_decimal(number)
case number
when Float, String
- number = BigDecimal(number.to_s)
+ BigDecimal(number.to_s)
when Rational
- number = BigDecimal(number, digit_count(number.to_i) + precision)
+ BigDecimal(number, digit_count(number.to_i) + precision)
else
- number = number.to_d
+ number.to_d
end
end