Преглед на файлове

[EventDispatcher] Minor memory optimization to getListeners()

Jordi Boggiano преди 14 години
родител
ревизия
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;
     }
 
     /**