Made the .unqiue() within .find() optional (speeds up calls).
This commit is contained in:
parent
c786f1097e
commit
cc70e03ec7
1 changed files with 10 additions and 6 deletions
16
src/core.js
16
src/core.js
|
@ -261,13 +261,17 @@ jQuery.fn = jQuery.prototype = {
|
||||||
},
|
},
|
||||||
|
|
||||||
find: function( selector ) {
|
find: function( selector ) {
|
||||||
var elems = jQuery.map(this, function(elem){
|
if ( this.length === 1 ) {
|
||||||
return jQuery.find( selector, elem );
|
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 ) ?
|
return this.pushStack( /[^+>] [^+>]/.test( selector ) ?
|
||||||
jQuery.unique( elems ) :
|
jQuery.unique( elems ) :
|
||||||
elems, "find", selector );
|
elems, "find", selector );
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
clone: function( events ) {
|
clone: function( events ) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue