]> source.dussan.org Git - jquery.git/commitdiff
Fix for #310 and #395
authorBrandon Aaron <brandon.aaron@gmail.com>
Wed, 15 Nov 2006 15:53:14 +0000 (15:53 +0000)
committerBrandon Aaron <brandon.aaron@gmail.com>
Wed, 15 Nov 2006 15:53:14 +0000 (15:53 +0000)
src/jquery/jquery.js

index 53ffc16e16e8e770b4a730e49d20bd06604f35f6..44eedf2525c80d8a0205f06c3b16396d5f36c000 100644 (file)
@@ -1648,12 +1648,8 @@ jQuery.extend({
                ">|/", "jQuery.sibling(a.firstChild)",
                "\\+", "jQuery.sibling(a).next",
                "~", function(a){
-                       var r = [];
                        var s = jQuery.sibling(a);
-                       if ( s.n > 0 )
-                               for ( var i = s.n; i < s.length; i++ )
-                                       r.push( s[i] );
-                       return r;
+                       return s.n >= 0 ? s.slice(s.n+1) : [];
                }
        ],