Преглед изворни кода

[ClassLoader] Got an if-condition out of a unnecessary loop

Baptiste "Talus" Clavie пре 13 година
родитељ
комит
6782287091
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      src/Composer/Autoload/ClassLoader.php

+ 2 - 2
src/Composer/Autoload/ClassLoader.php

@@ -181,8 +181,8 @@ class ClassLoader
         $classPath .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
 
         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)) {
                         return $dir . DIRECTORY_SEPARATOR . $classPath;
                     }