Skip to content
Permalink
Browse files

Bypass unnecessary foreach loop when $paths is empty to improve speed.

  • Loading branch information...
basuke committed Oct 5, 2011
1 parent 042e817 commit 810e2a4ffe415eda0374aa96eea43f08931fcdf7
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/Cake/Core/App.php
@@ -359,8 +359,13 @@ public static function build($paths = array(), $mode = App::PREPEND) {
}
}
if (empty($paths)) {
self::$_packages = $defaults;
return;
}
foreach ($defaults as $type => $default) {
if (empty(self::$_packages[$type]) || empty($paths)) {
if (empty(self::$_packages[$type])) {
self::$_packages[$type] = $default;
}

0 comments on commit 810e2a4

Please sign in to comment.
You can’t perform that action at this time.