Merge pull request #489 from Taluu/master
[ClassLoader] Optimization: condition that do not belong in a looppull/490/merge
commit
b2a2601e50
|
@ -181,8 +181,8 @@ class ClassLoader
|
||||||
$classPath .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
|
$classPath .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
|
||||||
|
|
||||||
foreach ($this->prefixes as $prefix => $dirs) {
|
foreach ($this->prefixes as $prefix => $dirs) {
|
||||||
foreach ($dirs as $dir) {
|
|
||||||
if (0 === strpos($class, $prefix)) {
|
if (0 === strpos($class, $prefix)) {
|
||||||
|
foreach ($dirs as $dir) {
|
||||||
if (file_exists($dir . DIRECTORY_SEPARATOR . $classPath)) {
|
if (file_exists($dir . DIRECTORY_SEPARATOR . $classPath)) {
|
||||||
return $dir . DIRECTORY_SEPARATOR . $classPath;
|
return $dir . DIRECTORY_SEPARATOR . $classPath;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue