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

[AstResolver][Performance] Remove unnecessary double File read on AstResolver::parseFileNameToDecoratedNodes() #4508

Merged
merged 3 commits into from
Jul 13, 2023

Conversation

samsonasik
Copy link
Member

No description provided.

@samsonasik samsonasik changed the title [AstResolver] Remove unnecessary double File read on AstResolver::parseFileNameToDecoratedNodes() [AstResolver][Performance] Remove unnecessary double File read on AstResolver::parseFileNameToDecoratedNodes() Jul 13, 2023
@@ -318,9 +316,8 @@ public function parseFileNameToDecoratedNodes(string $fileName): array
return $this->parsedFileNodes[$fileName] = [];
}

$file = new File($fileName, FileSystem::read($fileName));
Copy link
Member Author

Choose a reason for hiding this comment

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

file already read in previous parse get stmts before, we just need the stmts that already collected in previous line, no need to create new File object and re-read the file, just use the file path and decorate 👍

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba I am merging it ;)

@samsonasik samsonasik merged commit a12242d into main Jul 13, 2023
43 checks passed
@samsonasik samsonasik deleted the remove-double-read branch July 13, 2023 18:04
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