mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-23 00:46:16 -04:00
Changeset: Replace output params with return values
This improves readability and reduces the chances of introducing a bug.
This commit is contained in:
parent
94f5507671
commit
1955e7b263
2 changed files with 39 additions and 67 deletions
|
@ -273,7 +273,7 @@ PadDiff.prototype._createDeletionChangeset = function (cs, startAText, apool) {
|
|||
let curChar = 0;
|
||||
let curLineOpIter = null;
|
||||
let curLineOpIterLine;
|
||||
const curLineNextOp = Changeset.newOp('+');
|
||||
let curLineNextOp = Changeset.newOp('+');
|
||||
|
||||
const unpacked = Changeset.unpack(cs);
|
||||
const csIter = Changeset.opIterator(unpacked.ops);
|
||||
|
@ -287,7 +287,7 @@ PadDiff.prototype._createDeletionChangeset = function (cs, startAText, apool) {
|
|||
let indexIntoLine = 0;
|
||||
let done = false;
|
||||
while (!done) {
|
||||
curLineOpIter.next(curLineNextOp);
|
||||
curLineNextOp = curLineOpIter.next();
|
||||
if (indexIntoLine + curLineNextOp.chars >= curChar) {
|
||||
curLineNextOp.chars -= (curChar - indexIntoLine);
|
||||
done = true;
|
||||
|
@ -307,7 +307,7 @@ PadDiff.prototype._createDeletionChangeset = function (cs, startAText, apool) {
|
|||
}
|
||||
|
||||
if (!curLineNextOp.chars) {
|
||||
curLineOpIter.next(curLineNextOp);
|
||||
curLineNextOp = curLineOpIter.next();
|
||||
}
|
||||
|
||||
const charsToUse = Math.min(numChars, curLineNextOp.chars);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue