Skip to content
Permalink
Browse files
Remove $("body") case; $(document.body) is 2x faster.
  • Loading branch information
dmethvin authored and rwaldron committed Apr 18, 2012
1 parent abd2a07 commit 9ebc27d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
@@ -90,15 +90,6 @@ jQuery.fn = jQuery.prototype = {
return this;
}

// The body element only exists once, optimize finding it
if ( selector === "body" && !context && document.body ) {
this.context = document;
this[0] = document.body;
this.selector = selector;
this.length = 1;
return this;
}

// Handle HTML strings
if ( typeof selector === "string" ) {
// Are we dealing with HTML string or an ID?
Submodule sizzle updated 1 files
+18 −13 test/unit/selector.js

0 comments on commit 9ebc27d

Please sign in to comment.