Skip to content

[perf] Avoid call refactor() twice on AbstractRector#8077

Closed
samsonasik wants to merge 1 commit into
mainfrom
avoid-call-tiwce
Closed

[perf] Avoid call refactor() twice on AbstractRector#8077
samsonasik wants to merge 1 commit into
mainfrom
avoid-call-tiwce

Conversation

@samsonasik

Copy link
Copy Markdown
Member

@samsonasik

Copy link
Copy Markdown
Member Author

@TomasVotruba ready 👍

// whether it would actually have changed anything. Only a skip that prevents a real change
// counts as used; the original node is left untouched, so the file stays skipped either way.
$skipMatch = $this->skipper->matchSkip($this, $filePath);
$nodeToRefactor = $skipMatch instanceof SkipMatch ? $this->cloneNode($node) : $node;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is quite hard to read.

@TomasVotruba

Copy link
Copy Markdown
Member

It's called only once, see return null;

@samsonasik samsonasik deleted the avoid-call-tiwce branch June 22, 2026 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants