瀏覽代碼

[EventDispatcher] removed unneeded code

Fabien Potencier 14 年之前
父節點
當前提交
a3403e492e
共有 1 個文件被更改,包括 0 次插入7 次删除
  1. 0 7
      src/Symfony/Component/EventDispatcher/EventDispatcher.php

+ 0 - 7
src/Symfony/Component/EventDispatcher/EventDispatcher.php

@@ -94,13 +94,6 @@ class EventDispatcher implements EventDispatcherInterface
      */
      */
     public function addListener($eventName, $listener, $priority = 0)
     public function addListener($eventName, $listener, $priority = 0)
     {
     {
-        if (!isset($this->listeners[$eventName][$priority])) {
-            if (!isset($this->listeners[$eventName])) {
-                $this->listeners[$eventName] = array();
-            }
-            $this->listeners[$eventName][$priority] = array();
-        }
-
         $this->listeners[$eventName][$priority][] = $listener;
         $this->listeners[$eventName][$priority][] = $listener;
     }
     }