REFACTOR: use Ruby's sum
This commit is contained in:
parent
134a4c66b7
commit
b2a033e92b
|
@ -280,12 +280,9 @@ class PostRevisor
|
||||||
end
|
end
|
||||||
|
|
||||||
def diff_size(before, after)
|
def diff_size(before, after)
|
||||||
changes = 0
|
ONPDiff.new(before, after).short_diff.sum do |str, type|
|
||||||
ONPDiff.new(before, after).short_diff.each do |str, type|
|
type == :common ? 0 : str.size
|
||||||
next if type == :common
|
|
||||||
changes += str.length
|
|
||||||
end
|
end
|
||||||
changes
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def ninja_edit?
|
def ninja_edit?
|
||||||
|
|
Loading…
Reference in New Issue