Optimize emit for two arguments

This commit is contained in:
Ryan Dahl 2010-09-15 15:20:04 -07:00
parent feea1330cc
commit ae8f8e7258

View File

@ -21,7 +21,7 @@ process.EventEmitter.prototype.emit = function (type) {
if (!this._events[type]) return false;
if (typeof this._events[type] == 'function') {
if (arguments.length < 3) {
if (arguments.length <= 3) {
// fast case
this._events[type].call( this
, arguments[1]