mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 14:56:20 +00:00
7c1623d915
Avoid making a copy of the entire data array by using `doc.data` and `doc.data.getLength()` instead of `doc.getData()` and `doc.getData().length`. Get rid of some unnecessary conditionals in `Transaction.newFromWrap`: the `tx.pushReplace()` and `tx.pushRetain()` methods will already gracefully no-op if the replaced/retained region is empty; we don't need to add extra control flow to handle that case. Clarify offset math in `Transaction.newFromWrap`. Fix a minor bug in `Transaction.newFromInsertion`: the final retain didn't account for the length of the removed region, if `doc.fixupInsertion` creates one. (This usually doesn't happen.) Remove an inaccurate TODO in `Transaction.pushReplaceMetadata()` -- it is no longer a straight copy/paste of `Transaction.pushReplace`, so a refactor isn't really called for. Change-Id: I7d86a2449978365d69d4a5ed43116c2e9945475d |
||
---|---|---|
.. | ||
ce | ||
dm | ||
init | ||
test | ||
ui | ||
ve.BranchNode.js | ||
ve.debug.js | ||
ve.Document.js | ||
ve.Element.js | ||
ve.EventEmitter.js | ||
ve.Factory.js | ||
ve.js | ||
ve.LeafNode.js | ||
ve.NamedClassFactory.js | ||
ve.Node.js | ||
ve.Range.js | ||
ve.Registry.js | ||
ve.track.js |