summaryrefslogtreecommitdiff
path: root/src/backend/utils/misc/rbtree.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2011-04-10 11:42:00 -0400
committerBruce Momjian <bruce@momjian.us>2011-04-10 11:42:00 -0400
commitbf50caf105a901c4f83ac1df3cdaf910c26694a4 (patch)
treedac42d7795070f107eefb085c500f86a4d35f92f /src/backend/utils/misc/rbtree.c
parent9a8b73147c07e02e10e0d0a34aa99d72e3336fb2 (diff)
pgindent run before PG 9.1 beta 1.
Diffstat (limited to 'src/backend/utils/misc/rbtree.c')
-rw-r--r--src/backend/utils/misc/rbtree.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/backend/utils/misc/rbtree.c b/src/backend/utils/misc/rbtree.c
index 7a8ddf0a17e..f8143724d0a 100644
--- a/src/backend/utils/misc/rbtree.c
+++ b/src/backend/utils/misc/rbtree.c
@@ -75,7 +75,7 @@ struct RBTree
*/
#define RBNIL (&sentinel)
-static RBNode sentinel = {InitialState, RBBLACK, RBNIL, RBNIL, NULL};
+static RBNode sentinel = {InitialState, RBBLACK, RBNIL, RBNIL, NULL};
/*
@@ -99,10 +99,10 @@ static RBNode sentinel = {InitialState, RBBLACK, RBNIL, RBNIL, NULL};
*
* The freefunc should just be pfree or equivalent; it should NOT attempt
* to free any subsidiary data, because the node passed to it may not contain
- * valid data! freefunc can be NULL if caller doesn't require retail
+ * valid data! freefunc can be NULL if caller doesn't require retail
* space reclamation.
*
- * The RBTree node is palloc'd in the caller's memory context. Note that
+ * The RBTree node is palloc'd in the caller's memory context. Note that
* all contents of the tree are actually allocated by the caller, not here.
*
* Since tree contents are managed by the caller, there is currently not
@@ -130,6 +130,7 @@ rb_create(Size node_size,
tree->combiner = combiner;
tree->allocfunc = allocfunc;
tree->freefunc = freefunc;
+
tree->arg = arg;
return tree;
@@ -161,7 +162,7 @@ rb_find(RBTree *rb, const RBNode *data)
while (node != RBNIL)
{
- int cmp = rb->comparator(data, node, rb->arg);
+ int cmp = rb->comparator(data, node, rb->arg);
if (cmp == 0)
return node;
@@ -434,10 +435,11 @@ rb_insert(RBTree *rb, const RBNode *data, bool *isNew)
*/
*isNew = true;
- x = rb->allocfunc(rb->arg);
+ x = rb->allocfunc (rb->arg);
x->iteratorState = InitialState;
x->color = RBRED;
+
x->left = RBNIL;
x->right = RBNIL;
x->parent = parent;
@@ -629,7 +631,7 @@ rb_delete_node(RBTree *rb, RBNode *z)
/* Now we can recycle the y node */
if (rb->freefunc)
- rb->freefunc(y, rb->arg);
+ rb->freefunc (y, rb->arg);
}
/*