Add and apply Performance/Sum rubocop rule

We're not adding it for performance reasons but because it simplifies
the code.
This commit is contained in:
Javi Martín
2021-08-10 00:11:55 +02:00
parent ffc8ed738d
commit e619ca992c
5 changed files with 14 additions and 11 deletions

View File

@@ -18,6 +18,6 @@ module RemoteTranslations::Microsoft::SentencesParser
end
def characters_count(texts)
texts.map(&:size).reduce(:+)
texts.sum(&:size)
end
end

View File

@@ -384,7 +384,7 @@ namespace :proposal_actions do
5
]
votes_count = expected_supports.reduce(0.0) { |sum, x| sum + x }
votes_count = expected_supports.sum
goal_votes = Setting["votes_for_proposal_success"].to_f
cached_votes_up = 0