afinish = a.length-1
bfinish = b.length-1
mvector = []
-
+
# First we prune off any common elements at the beginning
while (astart <= afinish && bstart <= afinish && a[astart] == b[bstart])
mvector[astart] = bstart
astart += 1
bstart += 1
end
-
+
# now the end
while (astart <= afinish && bstart <= bfinish && a[afinish] == b[bfinish])
mvector[afinish] = bfinish
bmatches = b.reverse_hash(bstart..bfinish)
thresh = []
links = []
-
+
(astart..afinish).each { |aindex|
aelem = a[aindex]
next unless bmatches.has_key? aelem
@difftype = diffs_or_a.class
end
end
-
+
def match(ai, bi)
@diffs.push @curdiffs unless @curdiffs.empty?
@curdiffs = []