Skip to content

Commit

Permalink
minor optimalization at bundle initialization
Browse files Browse the repository at this point in the history
fast check to avoid six array method calls
  • Loading branch information
Gábor Tóth authored and fabpot committed Nov 30, 2013
1 parent b82ab2a commit 4ba6c0b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Symfony/Component/HttpKernel/Kernel.php
Expand Up @@ -495,7 +495,7 @@ protected function initializeBundles()
}

// look for orphans
if (count($diff = array_values(array_diff(array_keys($directChildren), array_keys($this->bundles))))) {
if (!empty($directChildren) && count($diff = array_values(array_diff(array_keys($directChildren), array_keys($this->bundles))))) {
throw new \LogicException(sprintf('Bundle "%s" extends bundle "%s", which is not registered.', $directChildren[$diff[0]], $diff[0]));
}

Expand Down

0 comments on commit 4ba6c0b

Please sign in to comment.