Redmine 4.1.1

This commit is contained in:
Manuel Cillero 2020-11-22 21:20:06 +01:00
parent 33e7b881a5
commit 3d976f1b3b
1593 changed files with 36180 additions and 19489 deletions

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module RedmineDiff
class Diff
@ -11,14 +13,14 @@ module RedmineDiff
mvector = []
# First we prune off any common elements at the beginning
while (astart <= afinish && bstart <= afinish && a[astart] == b[bstart])
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])
while (astart <= afinish) && (bstart <= bfinish) && (a[afinish] == b[bfinish])
mvector[afinish] = bfinish
afinish -= 1
bfinish -= 1
@ -32,7 +34,7 @@ module RedmineDiff
aelem = a[aindex]
next unless bmatches.has_key? aelem
k = nil
bmatches[aelem].reverse.each { |bindex|
bmatches[aelem].reverse_each { |bindex|
if k && (thresh[k] > bindex) && (thresh[k-1] < bindex)
thresh[k] = bindex
else
@ -188,10 +190,10 @@ module Diffable
end
self[low] = value
# $stderr << "replace #{value} : 0/#{low}/#{init_high} (#{steps} steps) (#{init_high-low} off )\n"
# $stderr.puts self.inspect
#gets
#p length - low
# $stderr << "replace #{value} : 0/#{low}/#{init_high} (#{steps} steps) (#{init_high-low} off )\n"
# $stderr.puts self.inspect
# gets
# p length - low
return low
end