Commit de636f16 authored by Tim Zallmann's avatar Tim Zallmann

Memory savings on diffLine Object

parent 7558a36e
...@@ -18,6 +18,22 @@ export default { ...@@ -18,6 +18,22 @@ export default {
const diffData = convertObjectPropsToCamelCase(data, { deep: true }); const diffData = convertObjectPropsToCamelCase(data, { deep: true });
let showingLines = 0; let showingLines = 0;
diffData.diffFiles.forEach(file => { diffData.diffFiles.forEach(file => {
if (file.parallelDiffLines) {
file.parallelDiffLines.forEach(line => {
// eslint-disable-next-line no-param-reassign
delete line.text;
});
}
if (file.highlightedDiffLines) {
file.highlightedDiffLines.forEach(line => {
// eslint-disable-next-line no-param-reassign
if (line.left) delete line.left.text;
// eslint-disable-next-line no-param-reassign
if (line.right) delete line.right.text;
});
}
if (file.highlightedDiffLines) { if (file.highlightedDiffLines) {
showingLines += file.parallelDiffLines.length; showingLines += file.parallelDiffLines.length;
Object.assign(file, { Object.assign(file, {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment