Skip to content

Commit d875236

Browse files
Optimize modules filtering in Magento\Framework\Module\ModuleList\Loader::load()
1 parent 94073e2 commit d875236

File tree

1 file changed

+3
-1
lines changed
  • lib/internal/Magento/Framework/Module/ModuleList

1 file changed

+3
-1
lines changed

lib/internal/Magento/Framework/Module/ModuleList/Loader.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ public function __construct(
7878
public function load(array $exclude = [])
7979
{
8080
$result = [];
81+
$excludeSet = array_flip($exclude);
82+
8183
foreach ($this->getModuleConfigs() as list($file, $contents)) {
8284
try {
8385
$this->parser->loadXML($contents);
@@ -93,7 +95,7 @@ public function load(array $exclude = [])
9395

9496
$data = $this->converter->convert($this->parser->getDom());
9597
$name = key($data);
96-
if (!in_array($name, $exclude)) {
98+
if (!isset($excludeSet[$name])) {
9799
$result[$name] = $data[$name];
98100
}
99101
}

0 commit comments

Comments
 (0)