Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Made the .unqiue() within .find() optional (speeds up calls).
- Loading branch information
Showing
with
10 additions
and
6 deletions.
-
+10
−6
src/core.js
There are no files selected for viewing
|
|
@@ -261,13 +261,17 @@ jQuery.fn = jQuery.prototype = { |
|
|
}, |
|
|
|
|
|
find: function( selector ) { |
|
|
var elems = jQuery.map(this, function(elem){ |
|
|
return jQuery.find( selector, elem ); |
|
|
}); |
|
|
if ( this.length === 1 ) { |
|
|
return this.pushStack( jQuery.find( selector, this[0] ), "find", selector ); |
|
|
} else { |
|
|
var elems = jQuery.map(this, function(elem){ |
|
|
return jQuery.find( selector, elem ); |
|
|
}); |
|
|
|
|
|
return this.pushStack( /[^+>] [^+>]/.test( selector ) ? |
|
|
jQuery.unique( elems ) : |
|
|
elems, "find", selector ); |
|
|
return this.pushStack( /[^+>] [^+>]/.test( selector ) ? |
|
|
jQuery.unique( elems ) : |
|
|
elems, "find", selector ); |
|
|
} |
|
|
}, |
|
|
|
|
|
clone: function( events ) { |
|
|
|