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

UnusedUsesSniff: improve performance in search annotation #935

Merged
merged 1 commit into from
Mar 24, 2020

Conversation

nightlinus
Copy link
Contributor

As we already have computed T_NAMESPACE pointers, we should use them in searchAnnotation scenario. Applied same optimization as in 9dac280

On my test file 2x (600ms vs 1200ms) speed improvement.

@@ -91,24 +91,17 @@ public function process(File $phpcsFile, $openTagPointer): void
if ($pointersBeforeUseStatements === []) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If you remove this if, it should probably fix the code coverage.

@kukulich kukulich merged commit 89e2147 into slevomat:master Mar 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants