Commit cc70e03e authored by John Resig's avatar John Resig

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

parent c786f109
...@@ -261,13 +261,17 @@ jQuery.fn = jQuery.prototype = { ...@@ -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 ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment