aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorVipul A M <vipulnsward@gmail.com>2017-06-04 15:42:16 +0530
committerVipul A M <vipulnsward@gmail.com>2017-06-04 15:42:16 +0530
commit3168da0af75bd05082be4909deaa1e3eb1e78e27 (patch)
tree6a63c7a82cd78ed408406614c54bf4bdb93f83b2 /activesupport
parent04b15abd0a6d70fae3cf656975346611ade77ae6 (diff)
downloadrails-3168da0af75bd05082be4909deaa1e3eb1e78e27.tar.gz
rails-3168da0af75bd05082be4909deaa1e3eb1e78e27.tar.bz2
rails-3168da0af75bd05082be4909deaa1e3eb1e78e27.zip
Don't create extra assignment, just return
Diffstat (limited to 'activesupport')
-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