Skip to content
Permalink
Browse files

Use a do-while statement to reduce redundant code

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
  • Loading branch information
rwaldron committed May 7, 2012
1 parent b26c34a commit 38fe2deab51f5230fff899950fc35aaac4d6a859
Showing with 3 additions and 4 deletions.
  1. +3 −4 src/traversing.js
@@ -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;
}

0 comments on commit 38fe2de

Please sign in to comment.
You can’t perform that action at this time.