mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
Changeset: Avoid unnecessary StringAssembler
class
This commit is contained in:
parent
2d0e393839
commit
cca906e8fc
6 changed files with 54 additions and 83 deletions
|
@ -328,21 +328,21 @@ PadDiff.prototype._createDeletionChangeset = function (cs, startAText, apool) {
|
|||
|
||||
const nextText = (numChars) => {
|
||||
let len = 0;
|
||||
const assem = Changeset.stringAssembler();
|
||||
let assem = '';
|
||||
const firstString = linesGet(curLine).substring(curChar);
|
||||
len += firstString.length;
|
||||
assem.append(firstString);
|
||||
assem += firstString;
|
||||
|
||||
let lineNum = curLine + 1;
|
||||
|
||||
while (len < numChars) {
|
||||
const nextString = linesGet(lineNum);
|
||||
len += nextString.length;
|
||||
assem.append(nextString);
|
||||
assem += nextString;
|
||||
lineNum++;
|
||||
}
|
||||
|
||||
return assem.toString().substring(0, numChars);
|
||||
return assem.substring(0, numChars);
|
||||
};
|
||||
|
||||
const cachedStrFunc = (func) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue