diff options
author | Rick Waldron <waldron.rick@gmail.com> | 2012-05-07 16:49:23 -0400 |
---|---|---|
committer | Rick Waldron <waldron.rick@gmail.com> | 2012-05-07 16:49:23 -0400 |
commit | 38fe2deab51f5230fff899950fc35aaac4d6a859 (patch) | |
tree | 1d996ab4a172015a9a32ac9495dbc060f246417d /src/traversing.js | |
parent | b26c34a69ffed321a1e9b506b31224fcaf64b3b0 (diff) | |
download | jquery-38fe2deab51f5230fff899950fc35aaac4d6a859.tar.gz jquery-38fe2deab51f5230fff899950fc35aaac4d6a859.zip |
Use a do-while statement to reduce redundant code
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
Diffstat (limited to 'src/traversing.js')
-rw-r--r-- | src/traversing.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/traversing.js b/src/traversing.js index c815511a9..aa8c10cc0 100644 --- a/src/traversing.js +++ b/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; } |