Commit cc70e03e authored by John Resig's avatar John Resig

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

parent c786f109
...@@ -261,6 +261,9 @@ jQuery.fn = jQuery.prototype = { ...@@ -261,6 +261,9 @@ jQuery.fn = jQuery.prototype = {
}, },
find: function( selector ) { find: function( selector ) {
if ( this.length === 1 ) {
return this.pushStack( jQuery.find( selector, this[0] ), "find", selector );
} else {
var elems = jQuery.map(this, function(elem){ var elems = jQuery.map(this, function(elem){
return jQuery.find( selector, elem ); return jQuery.find( selector, elem );
}); });
...@@ -268,6 +271,7 @@ jQuery.fn = jQuery.prototype = { ...@@ -268,6 +271,7 @@ jQuery.fn = jQuery.prototype = {
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