From 9fd6562044834f0b641b3c6f957e0175e802281a Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 17 Jul 2014 20:26:30 +0000 Subject: Follow up to r1611193: update the inserted node's top while looping should we have to create more than one top node (eg. preheight > 0). (the check on p != NULL can be omited since it can't be here). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1611466 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_skiplist.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'tables') diff --git a/tables/apr_skiplist.c b/tables/apr_skiplist.c index 1a57d4ee7..a299b7b16 100644 --- a/tables/apr_skiplist.c +++ b/tables/apr_skiplist.c @@ -482,11 +482,9 @@ static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, sl->top = sl->topend = tmp->prev = m; tmp->up = tmp->next = tmp->nextindex = tmp->previndex = NULL; tmp->down = p; - if (p) { - p->up = tmp; - } tmp->data = data; tmp->sl = sl; + p = p->up = tmp; } if (sl->index != NULL) { /* -- cgit v1.2.1