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

This commit is contained in:
Yosuke Basuke Suzuki 2011-10-05 15:08:30 +09:00
parent 042e817e1b
commit 810e2a4ffe

View file

@ -359,8 +359,13 @@ class App {
} }
} }
if (empty($paths)) {
self::$_packages = $defaults;
return;
}
foreach ($defaults as $type => $default) { foreach ($defaults as $type => $default) {
if (empty(self::$_packages[$type]) || empty($paths)) { if (empty(self::$_packages[$type])) {
self::$_packages[$type] = $default; self::$_packages[$type] = $default;
} }