Skip to content

Commit

Permalink
Use a do-while statement to reduce redundant code
Browse files Browse the repository at this point in the history
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
  • Loading branch information
rwaldron committed May 7, 2012
1 parent b26c34a commit 38fe2de
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/traversing.js
Expand Up @@ -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;
}

Expand Down

0 comments on commit 38fe2de

Please sign in to comment.