Skip to content

Commit

Permalink
fix: Fix the increase in running time caused by using 'concat'
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangst0816 authored and conorhastings committed Nov 14, 2021
1 parent cae6a5c commit 3d9b4ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function flattenCodeTree(tree, className = [], newTree = []) {
);
} else if (node.children) {
const classNames = className.concat(node.properties.className);
newTree = newTree.concat(flattenCodeTree(node.children, classNames));
flattenCodeTree(node.children, classNames).forEach(i => newTree.push(i));
}
}
return newTree;
Expand Down

0 comments on commit 3d9b4ac

Please sign in to comment.