Optimization of string splitting (#13812)

This commit is contained in:
Alexander Zaytsev 2021-10-05 21:15:55 +03:00 committed by GitHub
parent 64f14b05fa
commit 42c9edaf6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -147,7 +147,7 @@ export function codeFrameColumns(
const highlightedLines = highlighted ? highlight(rawLines, opts) : rawLines; const highlightedLines = highlighted ? highlight(rawLines, opts) : rawLines;
let frame = highlightedLines let frame = highlightedLines
.split(NEWLINE) .split(NEWLINE, end)
.slice(start, end) .slice(start, end)
.map((line, index) => { .map((line, index) => {
const number = start + 1 + index; const number = start + 1 + index;