Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve NodeComparator performance #3659

Merged
merged 2 commits into from Apr 22, 2023

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Apr 22, 2023

No description provided.

return false;
}
}

if (is_array($secondNode)) {
Assert::allIsAOf($secondNode, Node::class);

if ($firstNode === null) {
if (!is_array($firstNode)) {
return false;
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

goal of the changes is that we prevent the costly AST-print-compare as often as possible

@staabm staabm marked this pull request as ready for review April 22, 2023 17:37
@TomasVotruba TomasVotruba merged commit 731baeb into rectorphp:main Apr 22, 2023
37 checks passed
@TomasVotruba
Copy link
Member

Thanks 👍

@staabm staabm deleted the faster-comparator branch April 23, 2023 05:29
samsonasik pushed a commit that referenced this pull request May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants