From 1c7acd2c843d9f19a0b8ecee48ec48fa617eac5e Mon Sep 17 00:00:00 2001 From: Ryunosuke SATO Date: Mon, 10 Dec 2012 18:07:23 +0900 Subject: [PATCH] events: use assigned variable instead of arguments Always `arguments[0]` is used when `EventEmitter#emit` called. Using assigned variable is faster than `arguments[0]`. --- lib/events.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/events.js b/lib/events.js index fc933c5fd8..00c2071f28 100644 --- a/lib/events.js +++ b/lib/events.js @@ -48,8 +48,7 @@ EventEmitter.prototype.setMaxListeners = function(n) { // non-global reference, for speed. var PROCESS; -EventEmitter.prototype.emit = function() { - var type = arguments[0]; +EventEmitter.prototype.emit = function(type) { // If there is no 'error' event listener then throw. if (type === 'error') { if (!this._events || !this._events.error ||