lib/text_diff.rb in assert_value-1.5.3 vs lib/text_diff.rb in assert_value-1.5.4
- old
+ new
@@ -43,12 +43,10 @@
from = to = nextfrom = 0
offset = 0
diff.diffs.each do |tuple|
first = tuple[0][1]
- length = tuple.length
- action = tuple[0][0]
addcount = 0
remcount = 0
tuple.each do |l|
if l[0] == "+"
addcount += 1
@@ -63,11 +61,10 @@
to = first-1
nextfrom = to+remcount+1
end
result += self.chunk(a, from, to)
from = nextfrom
- lastdel = (tuple[0][0] == "-")
tuple.each do |l|
if l[0] == "-"
offset -= 1
else
offset += 1
@@ -78,10 +75,10 @@
if (a.length - from) > 2
result += self.chunk(a, from, from+2)
elsif a.length > 0
result += self.chunk(a, from, a.length-1)
end
- linecount = addcount = remcount = offset = current_offset = 0
+ linecount = addcount = remcount = offset = 0
info_index = nil
result.each_with_index do |l, i|
if l[0] == '@'
result[info_index] = self.record_stat(result, info_index, remcount, addcount,
linecount, offset) if info_index