Fixed optimize
This commit is contained in:
@@ -297,17 +297,17 @@ jQuery.extend(Mgly.diff.prototype, {
|
||||
},
|
||||
_optimize: function(ctx) {
|
||||
var start = 0, end = 0;
|
||||
while (start < ctx.length) {
|
||||
while ((start < ctx.length) && (ctx.modified[start] == undefined || ctx.modified[start] == false)) {
|
||||
while (start < ctx.codes.length) {
|
||||
while ((start < ctx.codes.length) && (ctx.modified[start] == undefined || ctx.modified[start] == false)) {
|
||||
start++;
|
||||
}
|
||||
end = start;
|
||||
while ((end < ctx.length) && (ctx.modified[end] == true)) {
|
||||
while ((end < ctx.codes.length) && (ctx.modified[end] == true)) {
|
||||
end++;
|
||||
}
|
||||
if ((end < ctx.length) && (ctx.ctx[start] == ctx.codes[end])) {
|
||||
ctx.modified[start] = false;
|
||||
ctx.modified[end] = true;
|
||||
if ((end < ctx.codes.length) && (ctx.codes[start] == ctx.codes[end])) {
|
||||
ctx.codes.modified[start] = false;
|
||||
ctx.codes.modified[end] = true;
|
||||
}
|
||||
else {
|
||||
start = end;
|
||||
|
||||
Reference in New Issue
Block a user