Skip to content

Calculate diff only once per file after refactoring#3711

Merged
samsonasik merged 5 commits intorectorphp:mainfrom
staabm:later-diff
Apr 30, 2023
Merged

Calculate diff only once per file after refactoring#3711
samsonasik merged 5 commits intorectorphp:mainfrom
staabm:later-diff

Conversation

@staabm
Copy link
Copy Markdown
Contributor

@staabm staabm commented Apr 29, 2023

@staabm staabm marked this pull request as ready for review April 29, 2023 20:04
@staabm staabm requested a review from TomasVotruba as a code owner April 29, 2023 20:04

$file->changeFileContent($newContent);
if ($configuration->shouldShowDiffs()) {
$this->fileDiffFileDecorator->decorate([$file]);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

generation of the file-diff (comparing contents, generate a diff) is slow.

therefore we just remember all other information while in flight and do the actual content comparison/diff generation only once after the loop

@samsonasik
Copy link
Copy Markdown
Member

Looking good, lets give it a try, thank you @staabm

@samsonasik samsonasik merged commit c3aca95 into rectorphp:main Apr 30, 2023
@staabm staabm deleted the later-diff branch April 30, 2023 05:45
samsonasik pushed a commit that referenced this pull request May 8, 2023
* Calculate diff only once per file after refactoring

* fix

* fix

* fix

* ecs
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