Merge pull request #41801 from Shopify/optimize-numeric-to-s

Optimize ActiveSupport::NumericWithFormat#to_s
This commit is contained in:
Jean Boussier 2021-03-31 09:22:43 +02:00 committed by GitHub
commit d612542336
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -107,9 +107,9 @@ module ActiveSupport
# separator: ',',
# significant: false) # => "1,2 Million"
def to_s(format = nil, options = nil)
return super() if format.nil?
case format
when nil
super()
when Integer, String
super(format)
when :phone