Skip to content
Browse files

Move declaration inside sortOrder as we don't need to do those checks…

… until later.
  • Loading branch information...
1 parent 2f96e52 commit 481721493a0592f55bb369b136bcdf4a1c4a6d10 @jeresig jeresig committed May 10, 2011
Showing with 9 additions and 8 deletions.
  1. +9 −8 sizzle.js
View
17 sizzle.js
@@ -921,13 +921,6 @@ if ( document.documentElement.compareDocumentPosition ) {
} else {
sortOrder = function( a, b ) {
- var al, bl,
- ap = [],
- bp = [],
- aup = a.parentNode,
- bup = b.parentNode,
- cur = aup;
-
// The nodes are identical, we can exit early
if ( a === b ) {
hasDuplicate = true;
@@ -936,9 +929,17 @@ if ( document.documentElement.compareDocumentPosition ) {
// Fallback to using sourceIndex (in IE) if it's available on both nodes
} else if ( a.sourceIndex && b.sourceIndex ) {
return a.sourceIndex - b.sourceIndex;
+ }
+
+ var al, bl,
+ ap = [],
+ bp = [],
+ aup = a.parentNode,
+ bup = b.parentNode,
+ cur = aup;
// If the nodes are siblings (or identical) we can do a quick check
- } else if ( aup === bup ) {
+ if ( aup === bup ) {
return siblingCheck( a, b );
// If no parents were found then the nodes are disconnected

0 comments on commit 4817214

Please sign in to comment.
Something went wrong with that request. Please try again.