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:
@@ -18,6 +18,6 @@ module RemoteTranslations::Microsoft::SentencesParser
|
||||
end
|
||||
|
||||
def characters_count(texts)
|
||||
texts.map(&:size).reduce(:+)
|
||||
texts.sum(&:size)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user