You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ji...@apache.org on 2012/11/19 22:10:51 UTC

svn commit: r1411415 - /httpd/httpd/trunk/server/mpm/eventopt/skiplist.c

Author: jim
Date: Mon Nov 19 21:10:51 2012
New Revision: 1411415

URL: http://svn.apache.org/viewvc?rev=1411415&view=rev
Log:
Some formatting and a bugfix

Modified:
    httpd/httpd/trunk/server/mpm/eventopt/skiplist.c

Modified: httpd/httpd/trunk/server/mpm/eventopt/skiplist.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/eventopt/skiplist.c?rev=1411415&r1=1411414&r2=1411415&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/eventopt/skiplist.c (original)
+++ httpd/httpd/trunk/server/mpm/eventopt/skiplist.c Mon Nov 19 21:10:51 2012
@@ -190,9 +190,7 @@ static int skiplisti_find_compare(Skipli
     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(Skipli
             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
     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
         }
         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
         sl->bottom = NULL;
     }
     AP_DEBUG_ASSERT(sl->height >= 0);
-    return sl->height;
+    return sl->height;  /* return 1; ?? */
 }
 
 int skiplist_remove_compare(Skiplist *sli,