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

Remove unnecessary check $this->posts[$slug] on PostRepository #1464

Merged
merged 1 commit into from
Apr 3, 2024

Conversation

samsonasik
Copy link
Collaborator

@samsonasik samsonasik commented Apr 2, 2024

slug seems never be a key, it is the values of the $this->posts data, so mark slug as key always never exists, see

$posts[$post->getId()] = $post;

use loop and compare its value instead per previous check.

@samsonasik
Copy link
Collaborator Author

All checks have passed 🎉 @TomasVotruba I think it is ready.

@TomasVotruba TomasVotruba merged commit 4738e64 into main Apr 3, 2024
4 checks passed
@TomasVotruba TomasVotruba deleted the remove-unused-slug-key branch April 3, 2024 05:35
@TomasVotruba
Copy link
Owner

Indeed, thanks 👍

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