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

[7.x] Optimize container #32194

Merged
merged 2 commits into from Apr 2, 2020
Merged

[7.x] Optimize container #32194

merged 2 commits into from Apr 2, 2020

Conversation

nguyenyou
Copy link
Contributor

What I saw is the getContextualConcrete method is called twice during the execution of the resolve method, in case the given $parameters is empty.

We're able to make it to be called once by capturing its return value, and then before calling the getConcrete method, we will check if that value is null. If the value is not null, just use it.

The behavior is exactly the same, the benefit is reducing an unnecessary method call.

@taylorotwell taylorotwell merged commit ed9228d into laravel:7.x Apr 2, 2020
@nguyenyou nguyenyou deleted the optimize-container branch April 3, 2020 08:51
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.

None yet

2 participants