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