Skip to content

Commit

Permalink
events: improve for-loop
Browse files Browse the repository at this point in the history
PR-URL: #26354
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
  • Loading branch information
gengjiawen authored and BridgeAR committed Mar 12, 2019
1 parent 7155aaf commit 8b0164a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,10 +390,7 @@ EventEmitter.prototype.removeAllListeners =

// Emit removeListener for all listeners on all events
if (arguments.length === 0) {
var keys = Object.keys(events);
var key;
for (i = 0; i < keys.length; ++i) {
key = keys[i];
for (const key of Object.keys(events)) {
if (key === 'removeListener') continue;
this.removeAllListeners(key);
}
Expand Down

0 comments on commit 8b0164a

Please sign in to comment.