aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2009-02-14 17:25:33 +0000
committerJohn Resig <jeresig@gmail.com>2009-02-14 17:25:33 +0000
commitd75c899fe78c52d89e5fb757ded979aca126d37b (patch)
treefa0edcd07ed8cb14c3dab802acc5c4f6620577db
parent868f262eed36c7f562f783e4cefb06db075b5e78 (diff)
downloadjquery-d75c899fe78c52d89e5fb757ded979aca126d37b.tar.gz
jquery-d75c899fe78c52d89e5fb757ded979aca126d37b.zip
Duplication checks are now handled directly in Sizzle, no need to do extra work in .find().
-rw-r--r--src/core.js10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/core.js b/src/core.js
index 508060a4e..b3142d0c6 100644
--- a/src/core.js
+++ b/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 );
}
},