summaryrefslogtreecommitdiff
path: root/src/splaytree.c
diff options
context:
space:
mode:
authorArno Töll <arno@debian.org>2012-11-21 23:03:45 +0100
committerArno Töll <arno@debian.org>2012-11-21 23:03:45 +0100
commit9fa7c3d770fb8688555b661940e04c3bf6b6d8aa (patch)
tree7d26c5c3a492656762910721988ee0867f7a57c4 /src/splaytree.c
parentc99b717062c6228c4ac6df3831702f81c9806df4 (diff)
downloadlighttpd-9fa7c3d770fb8688555b661940e04c3bf6b6d8aa.tar.gz
Imported Upstream version 1.4.13~r1385upstream/1.4.13_r1385
Diffstat (limited to 'src/splaytree.c')
-rw-r--r--src/splaytree.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/splaytree.c b/src/splaytree.c
index 3a80910..5d6a2b4 100644
--- a/src/splaytree.c
+++ b/src/splaytree.c
@@ -56,19 +56,19 @@
#define node_size splaytree_size
-/* Splay using the key i (which may or may not be in the tree.)
- * The starting root is t, and the tree used is defined by rat
+/* Splay using the key i (which may or may not be in the tree.)
+ * The starting root is t, and the tree used is defined by rat
* size fields are maintained */
splay_tree * splaytree_splay (splay_tree *t, int i) {
splay_tree N, *l, *r, *y;
int comp, root_size, l_size, r_size;
-
+
if (t == NULL) return t;
N.left = N.right = NULL;
l = r = &N;
root_size = node_size(t);
l_size = r_size = 0;
-
+
for (;;) {
comp = compare(i, t->key);
if (comp < 0) {
@@ -120,7 +120,7 @@ splay_tree * splaytree_splay (splay_tree *t, int i) {
y->size = r_size;
r_size -= 1+node_size(y->right);
}
-
+
l->right = t->left; /* assemble */
r->left = t->right;
t->left = N.right;