aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2011-04-11 13:19:00 -0400
committerDave Methvin <dave.methvin@gmail.com>2011-04-11 13:19:00 -0400
commita5071d49ba29ba115954845db9363aa6459f1a84 (patch)
tree7f71a149ff0128ddc4e9ce01b9fb5055ff4b1227
parent7957516671c4fbb54727f7b10a3e068d92c57f7a (diff)
downloadjquery-a5071d49ba29ba115954845db9363aa6459f1a84.tar.gz
jquery-a5071d49ba29ba115954845db9363aa6459f1a84.zip
Shave some time off array setup in trigger/handle
-rw-r--r--src/event.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/event.js b/src/event.js
index e6e7788da..097bc6501 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;