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 9ebc27db54194c88fa7aed29a8c648c330300ac8
Showing with 1 addition and 10 deletions.
  1. +0 −9 src/core.js
  2. +1 −1 src/sizzle
@@ -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.
You can’t perform that action at this time.