Просмотр исходного кода

[DependencyInjection] made a small performance optimization

Fabien Potencier 14 лет назад
Родитель
Сommit
be31bc091e
1 измененных файлов с 2 добавлено и 4 удалено
  1. 2 4
      src/Symfony/Component/DependencyInjection/ContainerBuilder.php

+ 2 - 4
src/Symfony/Component/DependencyInjection/ContainerBuilder.php

@@ -623,10 +623,8 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
      */
     public function findDefinition($id)
     {
-        $id = strtolower($id);
-
-        if ($this->hasAlias($id)) {
-            return $this->findDefinition((string) $this->getAlias($id));
+        while ($this->hasAlias($id)) {
+            $id = (string) $this->getAlias($id);
         }
 
         return $this->getDefinition($id);