You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by yl...@apache.org on 2015/03/08 11:13:55 UTC
svn commit: r1664960 - in /apr/apr/branches/1.6.x: tables/apr_skiplist.c
test/testskiplist.c
Author: ylavic
Date: Sun Mar 8 10:13:55 2015
New Revision: 1664960
URL: http://svn.apache.org/r1664960
Log:
skiplist: merge r1664958 from trunk.
When removing the last node, we have top = bottom = NULL,
and must set topend = bottomend = NULL too.
Also fix test from r1664471 according to r1664911.
Modified:
apr/apr/branches/1.6.x/tables/apr_skiplist.c
apr/apr/branches/1.6.x/test/testskiplist.c
Modified: apr/apr/branches/1.6.x/tables/apr_skiplist.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/tables/apr_skiplist.c?rev=1664960&r1=1664959&r2=1664960&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/tables/apr_skiplist.c (original)
+++ apr/apr/branches/1.6.x/tables/apr_skiplist.c Sun Mar 8 10:13:55 2015
@@ -606,7 +606,8 @@ static int skiplisti_remove(apr_skiplist
sl->height--;
}
if (!sl->top) {
- sl->bottom = NULL;
+ sl->bottom = sl->bottomend = NULL;
+ sl->topend = NULL;
}
return sl->height; /* return 1; ?? */
}
Modified: apr/apr/branches/1.6.x/test/testskiplist.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/test/testskiplist.c?rev=1664960&r1=1664959&r2=1664960&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/test/testskiplist.c (original)
+++ apr/apr/branches/1.6.x/test/testskiplist.c Sun Mar 8 10:13:55 2015
@@ -334,13 +334,13 @@ static void skiplist_test(abts_case *tc,
val = apr_skiplist_pop(list, NULL);
ABTS_INT_EQUAL(tc, *val, 1);
val = apr_skiplist_peek(list);
- ABTS_PTR_EQUAL(tc, val, &second_forty_two);
+ ABTS_PTR_EQUAL(tc, val, &first_forty_two);
ABTS_INT_EQUAL(tc, *val, 42);
val = apr_skiplist_pop(list, NULL);
- ABTS_PTR_EQUAL(tc, val, &second_forty_two);
+ ABTS_PTR_EQUAL(tc, val, &first_forty_two);
ABTS_INT_EQUAL(tc, *val, 42);
val = apr_skiplist_pop(list, NULL);
- ABTS_PTR_EQUAL(tc, val, &first_forty_two);
+ ABTS_PTR_EQUAL(tc, val, &second_forty_two);
ABTS_INT_EQUAL(tc, *val, 42);
val = apr_skiplist_peek(list);
ABTS_INT_EQUAL(tc, *val, 142);