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:
c786f10
)
Made the .unqiue() within .find() optional (speeds up calls).
author
John Resig
<jeresig@gmail.com>
Tue, 6 Jan 2009 16:17:50 +0000
(16:17 +0000)
committer
John Resig
<jeresig@gmail.com>
Tue, 6 Jan 2009 16:17:50 +0000
(16:17 +0000)
src/core.js
patch
|
blob
|
history
diff --git
a/src/core.js
b/src/core.js
index
ad94ce1
..
e2f1f0b
100644
(file)
--- a/
src/core.js
+++ b/
src/core.js
@@
-261,13
+261,17
@@
jQuery.fn = jQuery.prototype = {
},
find: function( selector ) {
},
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 ) {
},
clone: function( events ) {