Skip to content

Commit d75c899

Browse files
committed
Duplication checks are now handled directly in Sizzle, no need to do extra work in .find().
1 parent 868f262 commit d75c899

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/core.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -269,19 +269,15 @@ jQuery.fn = jQuery.prototype = {
269269
push: [].push,
270270

271271
find: function( selector ) {
272-
if ( this.length === 1 && !/,/.test(selector) ) {
272+
if ( this.length === 1 ) {
273273
var ret = this.pushStack( [], "find", selector );
274274
ret.length = 0;
275275
jQuery.find( selector, this[0], ret );
276276
return ret;
277277
} else {
278-
var elems = jQuery.map(this, function(elem){
278+
return this.pushStack( jQuery.unique(jQuery.map(this, function(elem){
279279
return jQuery.find( selector, elem );
280-
});
281-
282-
return this.pushStack( /[^+>] [^+>]/.test( selector ) ?
283-
jQuery.unique( elems ) :
284-
elems, "find", selector );
280+
})), "find", selector );
285281
}
286282
},
287283

0 commit comments

Comments
 (0)