Przeglądaj źródła

Simplification of if statement in EventDispatcher

Tristan Valcke 9 lat temu
rodzic
commit
844185efd8
1 zmienionych plików z 1 dodań i 7 usunięć
  1. 1 7
      src/core/EventDispatcher.js

+ 1 - 7
src/core/EventDispatcher.js

@@ -32,13 +32,7 @@ Object.assign( EventDispatcher.prototype, {
 
 		var listeners = this._listeners;
 
-		if ( listeners[ type ] !== undefined && listeners[ type ].indexOf( listener ) !== - 1 ) {
-
-			return true;
-
-		}
-
-		return false;
+		return ( listeners[ type ] !== undefined && listeners[ type ].indexOf( listener ) !== - 1 );
 
 	},
 

粤ICP备19079148号