From a5071d49ba29ba115954845db9363aa6459f1a84 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Mon, 11 Apr 2011 13:19:00 -0400 Subject: [PATCH] Shave some time off array setup in trigger/handle --- src/event.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/event.js b/src/event.js index e6e7788d..097bc650 100644 --- a/src/event.js +++ b/src/event.js @@ -354,7 +354,7 @@ jQuery.event = { event.target = elem; // Clone any incoming data and prepend the event, creating the handler arg list - data = jQuery.makeArray( data ); + data = data? jQuery.makeArray( data ) : []; data.unshift( event ); var cur = elem, @@ -419,7 +419,7 @@ jQuery.event = { // Snapshot the handlers list since a called handler may add/remove events. var handlers = ((jQuery._data( this, "events" ) || {})[ event.type ] || []).slice(0), run_all = !event.exclusive && !event.namespace, - args = jQuery.makeArray( arguments ); + args = Array.prototype.slice.call( arguments, 0 ); // Use the fix-ed Event rather than the (read-only) native event args[0] = event;