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 unnecessary IO #2613
Remove unnecessary IO #2613
Conversation
fad620f
to
d8ae564
Compare
...Reflection/BetterReflection/SourceLocator/ComposerJsonAndInstalledJsonSourceLocatorMaker.php
Show resolved
Hide resolved
foreach (array_merge($classMapFiles, $filePaths) as $file) { | ||
if (!is_file($file)) { | ||
continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about checking is_file
for $filePaths
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this change different to what already happened to previous version of the code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
before this PR, every path in classMapPaths
was checked twice via is_dir
/ is_file
. after the PR only once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh I see. I read your initial comment differently.
just reworked the code to get rid of array_filter()
.
Thank you. |
re-submit less controversial part of #2596
we don't need this
is_file
call (and also not the one below foris_dir
), because ofabove