Skip to content

Commit 1cc75d4

Browse files
authored
#24686: Static Content Deploy - Optimize files scanning performance
Fix one using array_merge in loop issue
1 parent e720b68 commit 1cc75d4

File tree

1 file changed

+3
-4
lines changed
  • lib/internal/Magento/Framework/App/Utility

1 file changed

+3
-4
lines changed

lib/internal/Magento/Framework/App/Utility/Files.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -371,12 +371,11 @@ public function getMainConfigFiles($asDataSet = true)
371371
}
372372
$globPaths = [BP . '/app/etc/config.xml', BP . '/app/etc/*/config.xml'];
373373
$configXmlPaths = array_merge($globPaths, $configXmlPaths);
374-
$files = [];
374+
$files = [[]];
375375
foreach ($configXmlPaths as $xmlPath) {
376-
// phpcs:ignore Magento2.Performance.ForeachArrayMerge
377-
$files = array_merge($files, glob($xmlPath, GLOB_NOSORT));
376+
$files[] = glob($xmlPath, GLOB_NOSORT);
378377
}
379-
self::$_cache[$cacheKey] = $files;
378+
self::$_cache[$cacheKey] = array_merge(...$files);
380379
}
381380
if ($asDataSet) {
382381
return self::composeDataSets(self::$_cache[$cacheKey]);

0 commit comments

Comments
 (0)