diff --git a/lib/internal/Magento/Framework/Module/ModuleList/Loader.php b/lib/internal/Magento/Framework/Module/ModuleList/Loader.php index 949f1a2cd5bb4..b1d21a6db5f16 100644 --- a/lib/internal/Magento/Framework/Module/ModuleList/Loader.php +++ b/lib/internal/Magento/Framework/Module/ModuleList/Loader.php @@ -78,6 +78,8 @@ public function __construct( public function load(array $exclude = []) { $result = []; + $excludeSet = array_flip($exclude); + foreach ($this->getModuleConfigs() as list($file, $contents)) { try { $this->parser->loadXML($contents); @@ -93,7 +95,7 @@ public function load(array $exclude = []) $data = $this->converter->convert($this->parser->getDom()); $name = key($data); - if (!in_array($name, $exclude)) { + if (!isset($excludeSet[$name])) { $result[$name] = $data[$name]; } }