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 redundant code #1055

Merged
merged 2 commits into from
Dec 5, 2024
Merged

Remove redundant code #1055

merged 2 commits into from
Dec 5, 2024

Conversation

chillbram
Copy link
Contributor

This PR removes a call to min() for two values that by virtue of the previous if statement must already be exactly identical. As they are always the same we can remove both the call to min() and one of the two ->getLength() calls.

@colinodell
Copy link
Member

Thanks for spotting this! Would you mind adding a comment like:

// Both are the same length so just return one of them

Something to remind me to not re-add silly logic again haha

@chillbram
Copy link
Contributor Author

Added a little comment 👍

Copy link
Member

@colinodell colinodell left a comment

Choose a reason for hiding this comment

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

Perfect, thank you so much!

@colinodell colinodell merged commit ceb835f into thephpleague:2.5 Dec 5, 2024
15 of 16 checks passed
@chillbram chillbram deleted the patch-1 branch December 5, 2024 16:44
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