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

Micro optimizations: cheap checks first #4510

Merged
merged 2 commits into from Jul 14, 2023
Merged

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Jul 14, 2023

No description provided.

if ($returnType === null) {
return null;
}

if ($node instanceof ClassMethod && $this->classMethodReturnTypeOverrideGuard->shouldSkipClassMethod(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

no need to invoke the type-overridde-guard, if we already have a return type

@TomasVotruba
Copy link
Member

Looks good 👍

@TomasVotruba TomasVotruba merged commit baa3943 into rectorphp:main Jul 14, 2023
41 checks passed
@staabm staabm deleted the cheap branch July 14, 2023 09:43
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