1
0
Fork 0

Merge pull request #489 from Taluu/master

[ClassLoader] Optimization: condition that do not belong in a loop
pull/490/merge
Nils Adermann 2012-03-22 03:32:23 -07:00
commit b2a2601e50
1 changed files with 3 additions and 3 deletions

View File

@ -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;
} }