diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2018-11-25 02:35:20 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-25 02:35:20 +0900 |
commit | f3a79e6aa5da48ac3e4d2fbedf44cb7b58f2a379 (patch) | |
tree | 2be27400a4dcf216105eb9dc24d50fa178b7899b /activesupport | |
parent | 171e32fc779fc26804f6670ea41850aec282d882 (diff) | |
parent | 3cfb05daa4f1e76eaca0a79fc9df340af02ee3dc (diff) | |
download | rails-f3a79e6aa5da48ac3e4d2fbedf44cb7b58f2a379.tar.gz rails-f3a79e6aa5da48ac3e4d2fbedf44cb7b58f2a379.tar.bz2 rails-f3a79e6aa5da48ac3e4d2fbedf44cb7b58f2a379.zip |
Merge pull request #34519 from composerinteralia/duration-inspect
Remove unnecessary reduce in Duration#inspect
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/duration.rb | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/duration.rb b/activesupport/lib/active_support/duration.rb index 88897f811e..314c926ac0 100644 --- a/activesupport/lib/active_support/duration.rb +++ b/activesupport/lib/active_support/duration.rb @@ -373,7 +373,6 @@ module ActiveSupport return "0 seconds" if parts.empty? parts. - reduce(::Hash.new(0)) { |h, (l, r)| h[l] += r; h }. sort_by { |unit, _ | PARTS.index(unit) }. map { |unit, val| "#{val} #{val == 1 ? unit.to_s.chop : unit.to_s}" }. to_sentence(locale: ::I18n.default_locale) |