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

[EventDispatcher] Minor memory optimization to getListeners()

Jordi Boggiano 14 лет назад
Родитель
Сommit
9816b6adc3
1 измененных файлов с 1 добавлено и 2 удалено
  1. 1 2
      src/Symfony/Component/EventDispatcher/EventDispatcher.php

+ 1 - 2
src/Symfony/Component/EventDispatcher/EventDispatcher.php

@@ -74,7 +74,6 @@ class EventDispatcher implements EventDispatcherInterface
             return $this->sorted[$eventName];
         }
 
-        $sorted = array();
         foreach (array_keys($this->listeners) as $eventName) {
             if (!isset($this->sorted[$eventName])) {
                 $this->sortListeners($eventName);
@@ -85,7 +84,7 @@ class EventDispatcher implements EventDispatcherInterface
             }
         }
 
-        return $sorted;
+        return $this->sorted;
     }
 
     /**