Browse Source

Simplification of if statement in EventDispatcher

Tristan Valcke 8 years ago
parent
commit
844185efd8
1 changed files with 1 additions and 7 deletions
  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 );
 
 	},