Changeset: Use `break` instead of `done` variable
parent
44d99733c6
commit
ca5bdddc59
|
@ -285,15 +285,13 @@ PadDiff.prototype._createDeletionChangeset = function (cs, startAText, apool) {
|
|||
curLineOpIter = Changeset.opIterator(aLinesGet(curLine));
|
||||
curLineOpIterLine = curLine;
|
||||
let indexIntoLine = 0;
|
||||
let done = false;
|
||||
while (!done && curLineOpIter.hasNext()) {
|
||||
while (curLineOpIter.hasNext()) {
|
||||
curLineNextOp = curLineOpIter.next();
|
||||
if (indexIntoLine + curLineNextOp.chars >= curChar) {
|
||||
curLineNextOp.chars -= (curChar - indexIntoLine);
|
||||
done = true;
|
||||
} else {
|
||||
indexIntoLine += curLineNextOp.chars;
|
||||
break;
|
||||
}
|
||||
indexIntoLine += curLineNextOp.chars;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2052,15 +2052,13 @@ exports.inverse = (cs, lines, alines, pool) => {
|
|||
curLineOpIter = exports.opIterator(alinesGet(curLine));
|
||||
curLineOpIterLine = curLine;
|
||||
let indexIntoLine = 0;
|
||||
let done = false;
|
||||
while (!done && curLineOpIter.hasNext()) {
|
||||
while (curLineOpIter.hasNext()) {
|
||||
curLineNextOp = curLineOpIter.next();
|
||||
if (indexIntoLine + curLineNextOp.chars >= curChar) {
|
||||
curLineNextOp.chars -= (curChar - indexIntoLine);
|
||||
done = true;
|
||||
} else {
|
||||
indexIntoLine += curLineNextOp.chars;
|
||||
break;
|
||||
}
|
||||
indexIntoLine += curLineNextOp.chars;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue