Skip to content

Commit 00f6b37

Browse files
committed
[perf] displayDataWithMarkdownMath - no cloneDeep
1 parent 8a04b12 commit 00f6b37

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/core/jupyter/display-data.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,13 @@ export function displayDataWithMarkdownMath(output: JupyterOutputDisplayData) {
123123
if (Array.isArray(output.data[kTextLatex]) && !output.data[kTextMarkdown]) {
124124
const latex = output.data[kTextLatex] as string[];
125125
if (displayDataLatexIsMath(latex)) {
126-
output = ld.cloneDeep(output);
127-
output.data[kTextMarkdown] = output.data[kTextLatex];
126+
output = {
127+
...output,
128+
data: {
129+
...output.data,
130+
[kTextMarkdown]: latex,
131+
},
132+
};
128133
return output;
129134
}
130135
}

0 commit comments

Comments
 (0)