diff options
-rw-r--r-- | src/traversing/findFilter.js | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/traversing/findFilter.js b/src/traversing/findFilter.js index 023a2cefb..268dad796 100644 --- a/src/traversing/findFilter.js +++ b/src/traversing/findFilter.js @@ -8,8 +8,6 @@ define( [ "use strict"; -var risSimple = /^.[^:#\[\.,]*$/; - // Implement the identical functionality for filter and not function winnow( elements, qualifier, not ) { if ( isFunction( qualifier ) ) { @@ -32,16 +30,8 @@ function winnow( elements, qualifier, not ) { } ); } - // Simple selector that can be filtered directly, removing non-Elements - if ( risSimple.test( qualifier ) ) { - return jQuery.filter( qualifier, elements, not ); - } - - // Complex selector, compare the two sets, removing non-Elements - qualifier = jQuery.filter( qualifier, elements ); - return jQuery.grep( elements, function( elem ) { - return ( indexOf.call( qualifier, elem ) > -1 ) !== not && elem.nodeType === 1; - } ); + // Filtered directly for both simple and complex selectors + return jQuery.filter( qualifier, elements, not ); } jQuery.filter = function( expr, elems, not ) { |