aboutsummaryrefslogtreecommitdiffstats
path: root/src/traversing.js
diff options
context:
space:
mode:
authorRick Waldron <waldron.rick@gmail.com>2012-05-07 16:49:23 -0400
committerRick Waldron <waldron.rick@gmail.com>2012-05-07 16:49:23 -0400
commit38fe2deab51f5230fff899950fc35aaac4d6a859 (patch)
tree1d996ab4a172015a9a32ac9495dbc060f246417d /src/traversing.js
parentb26c34a69ffed321a1e9b506b31224fcaf64b3b0 (diff)
downloadjquery-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.js7
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;
}