Commit fd2a2fed authored by John Resig's avatar John Resig

Optimized jQuery(Element) to not call jQuery() twice.

parent bbf3334d
...@@ -72,10 +72,13 @@ jQuery.fn = jQuery.prototype = { ...@@ -72,10 +72,13 @@ jQuery.fn = jQuery.prototype = {
} }
// Otherwise, we inject the element directly into the jQuery object // Otherwise, we inject the element directly into the jQuery object
ret = jQuery( elem || null ); this.length = elem ? 1 : 0;
ret.context = document; if ( elem ) {
ret.selector = selector; this[0] = elem;
return ret; }
this.context = document;
this.selector = selector;
return this;
} }
// HANDLE: $(expr, $(...)) // HANDLE: $(expr, $(...))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment