git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
868f262
)
Duplication checks are now handled directly in Sizzle, no need to do extra work in...
author
John Resig
<jeresig@gmail.com>
Sat, 14 Feb 2009 17:25:33 +0000
(17:25 +0000)
committer
John Resig
<jeresig@gmail.com>
Sat, 14 Feb 2009 17:25:33 +0000
(17:25 +0000)
src/core.js
patch
|
blob
|
history
diff --git
a/src/core.js
b/src/core.js
index
508060a
..
b3142d0
100644
(file)
--- a/
src/core.js
+++ b/
src/core.js
@@
-269,19
+269,15
@@
jQuery.fn = jQuery.prototype = {
push: [].push,
find: function( selector ) {
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 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 jQuery.find( selector, elem );
- });
-
- return this.pushStack( /[^+>] [^+>]/.test( selector ) ?
- jQuery.unique( elems ) :
- elems, "find", selector );
+ })), "find", selector );
}
},
}
},