Skip to content

Commit 0fd2a46

Browse files
committed
Changeset: Remove unused start index parameter for opIterator()
1 parent 43dae4c commit 0fd2a46

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
* `author`: Deprecated; use the new `authorId` property instead.
3939
* `readonly`: Deprecated; use the new `readOnly` property instead.
4040
* `rev`: Deprecated.
41+
* Changes to the `src/static/js/Changeset.js` library:
42+
* `opIterator()`: The unused start index parameter has been removed.
4143

4244
### Notable enhancements
4345

src/static/js/Changeset.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,11 @@ exports.newLen = (cs) => exports.unpack(cs).newLen;
142142
* Creates an iterator which decodes string changeset operations.
143143
*
144144
* @param {string} opsStr - String encoding of the change operations to perform.
145-
* @param {number} [optStartIndex=0] - From where in the string should the iterator start.
146145
* @returns {OpIter} Operator iterator object.
147146
*/
148-
exports.opIterator = (opsStr, optStartIndex) => {
147+
exports.opIterator = (opsStr) => {
149148
const regex = /((?:\*[0-9a-z]+)*)(?:\|([0-9a-z]+))?([-+=])([0-9a-z]+)|\?|/g;
150-
const startIndex = (optStartIndex || 0);
151-
let curIndex = startIndex;
149+
let curIndex = 0;
152150
let prevIndex = curIndex;
153151

154152
const nextRegexMatch = () => {
@@ -2037,7 +2035,7 @@ exports.makeAttribsString = (opcode, attribs, pool) => {
20372035
* Like "substring" but on a single-line attribution string.
20382036
*/
20392037
exports.subattribution = (astr, start, optEnd) => {
2040-
const iter = exports.opIterator(astr, 0);
2038+
const iter = exports.opIterator(astr);
20412039
const assem = exports.smartOpAssembler();
20422040
const attOp = exports.newOp();
20432041
const csOp = exports.newOp();

0 commit comments

Comments
 (0)