Skip to content

Commit

Permalink
Optimize modules filtering in Magento\Framework\Module\ModuleList\Loa…
Browse files Browse the repository at this point in the history
…der::load()
  • Loading branch information
andrey-legayev committed Oct 9, 2019
1 parent 94073e2 commit d875236
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/internal/Magento/Framework/Module/ModuleList/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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];
}
}
Expand Down

0 comments on commit d875236

Please sign in to comment.