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

Optimize ConstantArrayType::isKeysSupersetOf() #1729

Merged
merged 2 commits into from Sep 19, 2022

Conversation

rvanvelzen
Copy link
Contributor

Mostly implements the suggestions from phpstan/phpstan#7666 (comment). Single-item arrays are not collapsed because that breaks a lot of tests and I couldn't really figure out why.

@rvanvelzen rvanvelzen marked this pull request as ready for review September 19, 2022 08:38
@ondrejmirtes
Copy link
Member

Thank you, I really appreciate it! Do you also see how the logic that calls this method in TypeCombinator (along with mergeWith method) could be made faster?

@ondrejmirtes ondrejmirtes merged commit bd57fc5 into phpstan:1.8.x Sep 19, 2022
@rvanvelzen
Copy link
Contributor Author

I have some code locally that seems to improve it. It needs some more work to work in general but it's promising :)

@rvanvelzen rvanvelzen deleted the optimize-is-keys-superset-of branch September 20, 2022 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants