this._setLine(range.startLine, prefix + newLines[0]); for (var i = 1; i < newLines.length; ++i) this._lines.splice(range.startLine + i, 0, newLines[i]); // Adjust attributes, attributes move with the first character of line. var spliceParameters = new Array(newLines.length + 1); // 2 + number of items to insert. spliceParameters[0] = range.startColumn ? range.startLine + 1 : range.startLine; spliceParameters[1] = 0; here --> this._attributes.splice.apply(this._attributes, spliceParameters); spliceParameters is an preallocated array with ~132k elements
Created attachment 134246 [details] Patch
Comment on attachment 134246 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=134246&action=review > Source/WebCore/inspector/front-end/TextEditorModel.js:177 > + for (var i = 1; i < newLines.length; ++i) This looks weird here, can you add a comment?
Committed r112381: <http://trac.webkit.org/changeset/112381>