lib/tdiff/unordered.rb in tdiff-0.2.0 vs lib/tdiff/unordered.rb in tdiff-0.3.0
- old
+ new
@@ -36,11 +36,11 @@
#
def tdiff_unordered(tree,&block)
return enum_for(:tdiff_unordered,tree) unless block
# check if the nodes differ
- unless tdiff_equal(self,tree)
+ unless tdiff_equal(tree)
yield '-', self
yield '+', tree
return self
end
@@ -50,10 +50,10 @@
unchanged = {}
changes = []
x.each_with_index do |xi,i|
y.each_with_index do |yj,j|
- if (!unchanged.has_value?(yj) && tdiff_equal(xi,yj))
+ if (!unchanged.has_value?(yj) && xi.tdiff_equal(yj))
unchanged[xi] = yj
changes << [i, ' ', xi]
break
end
end