httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1411415 - /httpd/httpd/trunk/server/mpm/eventopt/skiplist.c
Date Mon, 19 Nov 2012 21:10:51 GMT
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,



Mime
View raw message