提交 32aebe68 编写于 作者: A Alex Dima

Hint lines array size for faster model creation (#30180)

上级 eb2601ba
......@@ -774,7 +774,7 @@ export class TextModel implements editorCommon.ITextModel {
private _constructLines(textSource: ITextSource): void {
const tabSize = this._options.tabSize;
let rawLines = textSource.lines;
let modelLines: IModelLine[] = [];
let modelLines: IModelLine[] = new Array<IModelLine>(rawLines.length);
for (let i = 0, len = rawLines.length; i < len; i++) {
modelLines[i] = this._createModelLine(rawLines[i], tabSize);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册