Skip to content
Permalink
Browse files

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

  • Loading branch information
jeresig committed Jul 11, 2009
1 parent bbf3334 commit fd2a2fed84b6c32e24a050356a8f422310bae927
Showing with 7 additions and 4 deletions.
  1. +7 −4 src/core.js
@@ -72,10 +72,13 @@ jQuery.fn = jQuery.prototype = {
}

// Otherwise, we inject the element directly into the jQuery object
ret = jQuery( elem || null );
ret.context = document;
ret.selector = selector;
return ret;
this.length = elem ? 1 : 0;
if ( elem ) {
this[0] = elem;
}
this.context = document;
this.selector = selector;
return this;
}

// HANDLE: $(expr, $(...))

0 comments on commit fd2a2fe

Please sign in to comment.
You can’t perform that action at this time.