Procházet zdrojové kódy

Simplification of if statement in EventDispatcher

Tristan Valcke před 9 roky
rodič
revize
844185efd8
1 změnil soubory, kde provedl 1 přidání a 7 odebrání
  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号