Skip to content

fix: Maximum call stack size exceeded for large diffs - #561

Merged
rtfpessoa merged 2 commits into
rtfpessoa:masterfrom
Themezv:fix-maximum-call-stack-size-exceeded
Jul 7, 2025
Merged

fix: Maximum call stack size exceeded for large diffs#561
rtfpessoa merged 2 commits into
rtfpessoa:masterfrom
Themezv:fix-maximum-call-stack-size-exceeded

Conversation

@Themezv

@Themezv Themezv commented Jun 30, 2025

Copy link
Copy Markdown
Contributor

When processing large diffs containing thousands of lines, the application would throw "Maximum call stack size exceeded" errors. This occurred in the applyRematchMatching method when calculating the maximum line size in a block.

null,
[0].concat(oldLines.concat(newLines).map(elem => elem.content.length)),
);
const maxLineSizeInBlock = max(oldLines.concat(newLines).map(elem => elem.content.length));

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if we could also avoid the concat, have you considered that?

@rtfpessoa
rtfpessoa merged commit 9aa780e into rtfpessoa:master Jul 7, 2025
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants