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.

@staabm staabm requested a review from TomasVotruba as a code owner July 14, 2023 09:18
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
@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
Development

Successfully merging this pull request may close these issues.

2 participants