REFACTOR: use Ruby's sum

This commit is contained in:
Régis Hanol 2019-06-27 01:54:40 +02:00
parent 134a4c66b7
commit b2a033e92b
1 changed files with 2 additions and 5 deletions

View File

@ -280,12 +280,9 @@ class PostRevisor
end
def diff_size(before, after)
changes = 0
ONPDiff.new(before, after).short_diff.each do |str, type|
next if type == :common
changes += str.length
ONPDiff.new(before, after).short_diff.sum do |str, type|
type == :common ? 0 : str.size
end
changes
end
def ninja_edit?