mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Bypass unnecessary foreach loop when $paths is empty to improve speed.
This commit is contained in:
parent
042e817e1b
commit
810e2a4ffe
1 changed files with 6 additions and 1 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue