From 1d77bb29559f6773781f3223ab38b6f8d041359e Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 22 Jun 2011 16:07:30 +0100 Subject: [PATCH] _dbus_list_pop_last_link: remove, unused --- dbus/dbus-list.c | 31 ++----------------------------- dbus/dbus-list.h | 1 - 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/dbus/dbus-list.c b/dbus/dbus-list.c index f8f1c4a..fff69b9 100644 --- a/dbus/dbus-list.c +++ b/dbus/dbus-list.c @@ -673,29 +673,6 @@ _dbus_list_pop_last (DBusList **list) return data; } -#ifdef DBUS_BUILD_TESTS -/** - * Removes the last link in the list and returns it. This is a - * constant-time operation. - * - * @param list address of the list head. - * @returns the last link in the list, or #NULL for an empty list. - */ -DBusList* -_dbus_list_pop_last_link (DBusList **list) -{ - DBusList *link; - - link = _dbus_list_get_last_link (list); - if (link == NULL) - return NULL; - - _dbus_list_unlink (list, link); - - return link; -} -#endif /* DBUS_BUILD_TESTS */ - /** * Copies a list. This is a linear-time operation. If there isn't * enough memory to copy the entire list, the destination list will be @@ -1057,7 +1034,6 @@ _dbus_list_test (void) DBusList *got_link1; DBusList *got_link2; - DBusList *link1; DBusList *link2; void *data1; @@ -1065,17 +1041,14 @@ _dbus_list_test (void) got_link1 = _dbus_list_get_last_link (&list1); got_link2 = _dbus_list_get_first_link (&list2); - - link1 = _dbus_list_pop_last_link (&list1); + link2 = _dbus_list_pop_first_link (&list2); - _dbus_assert (got_link1 == link1); _dbus_assert (got_link2 == link2); - data1 = link1->data; + data1 = _dbus_list_pop_last (&list1); data2 = link2->data; - _dbus_list_free_link (link1); _dbus_list_free_link (link2); _dbus_assert (_DBUS_POINTER_TO_INT (data1) == i); diff --git a/dbus/dbus-list.h b/dbus/dbus-list.h index 2e346d5..910d738 100644 --- a/dbus/dbus-list.h +++ b/dbus/dbus-list.h @@ -69,7 +69,6 @@ void* _dbus_list_get_first (DBusList **list); void* _dbus_list_pop_first (DBusList **list); void* _dbus_list_pop_last (DBusList **list); DBusList* _dbus_list_pop_first_link (DBusList **list); -DBusList* _dbus_list_pop_last_link (DBusList **list); dbus_bool_t _dbus_list_copy (DBusList **list, DBusList **dest); int _dbus_list_get_length (DBusList **list); -- 1.7.5.4