From 96ed42af3349625189dc7eca226c8547804fe645 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Mon, 19 Nov 2012 21:10:51 +0000 Subject: [PATCH] Some formatting and a bugfix git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1411415 13f79535-47bb-0310-9956-ffa450edef68 --- server/mpm/eventopt/skiplist.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/server/mpm/eventopt/skiplist.c b/server/mpm/eventopt/skiplist.c index 39a927f9cb..901cbff02f 100644 --- a/server/mpm/eventopt/skiplist.c +++ b/server/mpm/eventopt/skiplist.c @@ -190,9 +190,7 @@ static int skiplisti_find_compare(Skiplist *sl, void *data, m = sl->top; while (m) { int compared; - if (m->next) { - compared = comp(data, m->next->data); - } + compared = (m->next) ? comp(data, m->next->data) : -1; if (compared == 0) { m = m->next; while (m->down) { @@ -202,10 +200,12 @@ static int skiplisti_find_compare(Skiplist *sl, void *data, return count; } if ((m->next == NULL) || (compared < 0)) { - m = m->down, count++; + m = m->down; + count++; } else { - m = m->next, count++; + m = m->next; + count++; } } *ret = NULL; @@ -557,10 +557,6 @@ static int skiplisti_remove(Skiplist *sl, skiplistnode *m, FreeFunc myfree) if (m->nextindex) { skiplisti_remove(m->nextindex->sl, m->nextindex, NULL); } - else { - sl->size--; - } - while (m->up) { m = m->up; } @@ -577,6 +573,7 @@ static int skiplisti_remove(Skiplist *sl, skiplistnode *m, FreeFunc myfree) } skiplist_free(sl, p); } + sl->size--; while (sl->top && sl->top->next == NULL) { /* While the row is empty and we are not on the bottom row */ p = sl->top; @@ -591,7 +588,7 @@ static int skiplisti_remove(Skiplist *sl, skiplistnode *m, FreeFunc myfree) sl->bottom = NULL; } AP_DEBUG_ASSERT(sl->height >= 0); - return sl->height; + return sl->height; /* return 1; ?? */ } int skiplist_remove_compare(Skiplist *sli, -- 2.40.0