Skip to content
Permalink
Browse files

Made the .unqiue() within .find() optional (speeds up calls).

  • Loading branch information
jeresig committed Jan 6, 2009
1 parent c786f10 commit cc70e03ec7387aaab5f1e090fde2a3faeb001ba6
Showing with 10 additions and 6 deletions.
  1. +10 −6 src/core.js
@@ -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 ) {

0 comments on commit cc70e03

Please sign in to comment.
You can’t perform that action at this time.