Explorar el Código

Simplification of if statement in EventDispatcher

Tristan Valcke hace 9 años
padre
commit
844185efd8
Se han modificado 1 ficheros con 1 adiciones y 7 borrados
  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号