Duplication checks are now handled directly in Sizzle, no need to do extra work in .find().
This commit is contained in:
parent
868f262eed
commit
d75c899fe7
1 changed files with 3 additions and 7 deletions
10
src/core.js
10
src/core.js
|
@ -269,19 +269,15 @@ jQuery.fn = jQuery.prototype = {
|
|||
push: [].push,
|
||||
|
||||
find: function( selector ) {
|
||||
if ( this.length === 1 && !/,/.test(selector) ) {
|
||||
if ( this.length === 1 ) {
|
||||
var ret = this.pushStack( [], "find", selector );
|
||||
ret.length = 0;
|
||||
jQuery.find( selector, this[0], ret );
|
||||
return ret;
|
||||
} else {
|
||||
var elems = jQuery.map(this, function(elem){
|
||||
return this.pushStack( jQuery.unique(jQuery.map(this, function(elem){
|
||||
return jQuery.find( selector, elem );
|
||||
});
|
||||
|
||||
return this.pushStack( /[^+>] [^+>]/.test( selector ) ?
|
||||
jQuery.unique( elems ) :
|
||||
elems, "find", selector );
|
||||
})), "find", selector );
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue