]> source.dussan.org Git - jquery.git/commitdiff
Use a do-while statement to reduce redundant code
authorRick Waldron <waldron.rick@gmail.com>
Mon, 7 May 2012 20:49:23 +0000 (16:49 -0400)
committerRick Waldron <waldron.rick@gmail.com>
Mon, 7 May 2012 20:49:23 +0000 (16:49 -0400)
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
src/traversing.js

index c815511a9c23d36eeaed899602831ba0525fa7c6..aa8c10cc04ebc690201f831d7cadeb6e7fe80e38 100644 (file)
@@ -175,11 +175,10 @@ function isDisconnected( node ) {
 }
 
 function sibling( cur, dir ) {
-       cur = cur[ dir ];
-
-       while ( cur.nodeType !== 1 ) {
+       do {
                cur = cur[ dir ];
-       }
+       } while ( cur.nodeType !== 1 );
+
        return cur;
 }