diff options
author | Richard Gibson <richard.gibson@gmail.com> | 2014-01-17 00:38:56 -0500 |
---|---|---|
committer | Richard Gibson <richard.gibson@gmail.com> | 2014-01-17 00:38:56 -0500 |
commit | 391c21b15d769fac1c37631b28c0226f57a59796 (patch) | |
tree | dcd2224095bcaec30b7e4114a89b0da196d71ba3 /src/traversing | |
parent | a2250b0f4c157745b8cd8ac1247c6084882c500f (diff) | |
download | jquery-391c21b15d769fac1c37631b28c0226f57a59796.tar.gz jquery-391c21b15d769fac1c37631b28c0226f57a59796.zip |
Traversing: Check all pairwise element combinations for .find( els )
Ref b8d0d54a3c4960794a1b492957abeb56eddd1e48
Fixes #14701
Diffstat (limited to 'src/traversing')
-rw-r--r-- | src/traversing/findFilter.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/traversing/findFilter.js b/src/traversing/findFilter.js index f903ac715..dd70a73f7 100644 --- a/src/traversing/findFilter.js +++ b/src/traversing/findFilter.js @@ -53,14 +53,14 @@ jQuery.filter = function( expr, elems, not ) { jQuery.fn.extend({ find: function( selector ) { - var i = 0, + var i, len = this.length, ret = [], self = this; if ( typeof selector !== "string" ) { return this.pushStack( jQuery( selector ).filter(function() { - for ( ; i < len; i++ ) { + for ( i = 0; i < len; i++ ) { if ( jQuery.contains( self[ i ], this ) ) { return true; } @@ -68,8 +68,7 @@ jQuery.fn.extend({ }) ); } - i = 0; - for ( ; i < len; i++ ) { + for ( i = 0; i < len; i++ ) { jQuery.find( selector, self[ i ], ret ); } |