@@ -9,14 +9,14 module RedmineDiff | |||
|
9 | 9 | afinish = a.length-1 |
|
10 | 10 | bfinish = b.length-1 |
|
11 | 11 | mvector = [] |
|
12 | ||
|
12 | ||
|
13 | 13 | # First we prune off any common elements at the beginning |
|
14 | 14 | while (astart <= afinish && bstart <= afinish && a[astart] == b[bstart]) |
|
15 | 15 | mvector[astart] = bstart |
|
16 | 16 | astart += 1 |
|
17 | 17 | bstart += 1 |
|
18 | 18 | end |
|
19 | ||
|
19 | ||
|
20 | 20 | # now the end |
|
21 | 21 | while (astart <= afinish && bstart <= bfinish && a[afinish] == b[bfinish]) |
|
22 | 22 | mvector[afinish] = bfinish |
@@ -27,7 +27,7 module RedmineDiff | |||
|
27 | 27 | bmatches = b.reverse_hash(bstart..bfinish) |
|
28 | 28 | thresh = [] |
|
29 | 29 | links = [] |
|
30 | ||
|
30 | ||
|
31 | 31 | (astart..afinish).each { |aindex| |
|
32 | 32 | aelem = a[aindex] |
|
33 | 33 | next unless bmatches.has_key? aelem |
@@ -118,7 +118,7 module RedmineDiff | |||
|
118 | 118 | @difftype = diffs_or_a.class |
|
119 | 119 | end |
|
120 | 120 | end |
|
121 | ||
|
121 | ||
|
122 | 122 | def match(ai, bi) |
|
123 | 123 | @diffs.push @curdiffs unless @curdiffs.empty? |
|
124 | 124 | @curdiffs = [] |
General Comments 0
You need to be logged in to leave comments.
Login now