-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Config] Fix files sorting in GlobResource #43591
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
Conversation
It should be on path and not on info and it's a big perf boost: https://blackfire.io/profiles/compare/27f409a5-73c7-4285-9b58-e631abbdb325/graph
That's a behavior change, so should be on 5.4. |
@@ -156,7 +156,7 @@ function (\SplFileInfo $file, $path) { | |||
), | |||
\RecursiveIteratorIterator::LEAVES_ONLY | |||
)); | |||
uasort($files, 'strnatcmp'); | |||
uksort($files, 'strnatcmp'); |
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.
that's a bug to me: sorting was supposed to happen on keys, not on values
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.
I get it, but it's been like that for years.
@fabpot I don't think it changes the behavior. casting the SplFileInfo to string (when passing the value to For the initial sort, this is an optimisation to try to have an array that is already partially sorted when merging the arrays of different paths. Using |
Thank you @lyrixx. |
It should be on path and not on info
and it's a big perf boost: https://blackfire.io/profiles/compare/27f409a5-73c7-4285-9b58-e631abbdb325/graph