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

Improve performance again by dumbing down nested arrays #2077

Merged
merged 1 commit into from Dec 20, 2022

Conversation

ondrejmirtes
Copy link
Member

No description provided.

if (self::accepts($innerType, $acceptedType, $strictTypes)) {
return true;
}
$results[] = self::innerAccepts($innerType, $acceptedType, $strictTypes);
Copy link
Contributor

Choose a reason for hiding this comment

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

it might make sense to use lazyOr so it may early exit

Copy link
Contributor

Choose a reason for hiding this comment

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

(or you just return from within the loop on YES)

@ondrejmirtes ondrejmirtes marked this pull request as ready for review December 20, 2022 22:11
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

@ondrejmirtes ondrejmirtes merged commit 7922d30 into 1.9.x Dec 20, 2022
@ondrejmirtes ondrejmirtes deleted the dumb-down-arrays branch December 20, 2022 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants