Selaa lähdekoodia

[EventDispatcher] Minor memory optimization to getListeners()

Jordi Boggiano 14 vuotta sitten
vanhempi
commit
9816b6adc3
1 muutettua tiedostoa jossa 1 lisäystä ja 2 poistoa
  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;
     }
 
     /**