From 2d2fe15881214fc7f331066ad920d592a4b86704 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Tue, 19 Oct 2021 17:08:18 +0200 Subject: [PATCH] [Config] Fix files sorting in GlobResource 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 --- src/Symfony/Component/Config/Resource/GlobResource.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Config/Resource/GlobResource.php b/src/Symfony/Component/Config/Resource/GlobResource.php index f9429eb8f9bd9..3657f6dcb9500 100644 --- a/src/Symfony/Component/Config/Resource/GlobResource.php +++ b/src/Symfony/Component/Config/Resource/GlobResource.php @@ -123,7 +123,7 @@ public function getIterator() } if (null !== $paths) { - sort($paths); + natsort($paths); foreach ($paths as $path) { if ($this->excludedPrefixes) { $normalizedPath = str_replace('\\', '/', $path); @@ -156,7 +156,7 @@ function (\SplFileInfo $file, $path) { ), \RecursiveIteratorIterator::LEAVES_ONLY )); - uasort($files, 'strnatcmp'); + uksort($files, 'strnatcmp'); foreach ($files as $path => $info) { if ($info->isFile()) {