aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorjeresig <jeresig@gmail.com>2011-01-14 11:23:05 -0500
committerjeresig <jeresig@gmail.com>2011-01-14 11:23:05 -0500
commita7ab491a5d3c7347ee5685bd6df11092f0d638ca (patch)
tree9d1d2637153b9039fdb33f271d61c235a4bf83a1 /src
parent52a02383fa521c51d9996a46f03a7080dd825f11 (diff)
parente5ee89ec9a11804b39e9722f47eeeb00648f37ea (diff)
downloadjquery-a7ab491a5d3c7347ee5685bd6df11092f0d638ca.tar.gz
jquery-a7ab491a5d3c7347ee5685bd6df11092f0d638ca.zip
Merge branch 'master' of https://github.com/scottgonzalez/jquery
Diffstat (limited to 'src')
-rw-r--r--src/traversing.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/traversing.js b/src/traversing.js
index 8187357e7..b36ce3db8 100644
--- a/src/traversing.js
+++ b/src/traversing.js
@@ -6,7 +6,14 @@ var runtil = /Until$/,
rmultiselector = /,/,
isSimple = /^.[^:#\[\.,]*$/,
slice = Array.prototype.slice,
- POS = jQuery.expr.match.POS;
+ POS = jQuery.expr.match.POS,
+ // methods guaranteed to produce a unique set when starting from a unique set
+ guaranteedUnique = {
+ children: true,
+ contents: true,
+ next: true,
+ prev: true
+ };
jQuery.fn.extend({
find: function( selector ) {
@@ -207,7 +214,7 @@ jQuery.each({
ret = jQuery.filter( selector, ret );
}
- ret = this.length > 1 ? jQuery.unique( ret ) : ret;
+ ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
ret = ret.reverse();