Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=50167412f1d0c34116d7b30557a84de4b16f0303
commit 50167412f1d0c34116d7b30557a84de4b16f0303 Author: Michel Hermier <[email protected]> Date: Fri Sep 26 10:53:21 2014 +0200 libpacman: Remove now unused f_ptrlist_add_sorted _pacman_list_remove. diff --git a/lib/libpacman/util/fptrlist.cpp b/lib/libpacman/util/fptrlist.cpp index e9f2832..7001937 100644 --- a/lib/libpacman/util/fptrlist.cpp +++ b/lib/libpacman/util/fptrlist.cpp @@ -25,46 +25,6 @@ #include "fptrlist.h" #include "fstdlib.h" -/* Add items to a list in sorted order. Use the given comparison function to - * determine order. - */ -FPtrList *f_ptrlist_add_sorted(FPtrList *list, void *data, _pacman_fn_cmp fn) -{ - if(list == NULL) { - list = new FPtrList(); - } - - FPtrListItem *add = new FPtrListItem(data); - - /* Find insertion point. */ - FPtrListItem *previous, *end; - for(previous = end = list->c_end(); previous->next() != end; previous = previous->next()) { - if(fn(data, previous->next()->m_data) <= 0) { - break; - } - } - - /* Insert node before insertion point. */ - add->insert_after(previous); - return list; -} - -/* Remove an item in a list. Use the given comparison function to find the - * item. - * If the item is found, return true and 'data' is pointing to the removed element. - * Otherwise, return false and 'data' it is set to NULL. - * Return the new list (without the removed element). - */ -bool _pacman_list_remove(FPtrList *self, void *ptr, _pacman_fn_cmp fn, void **data) -{ - if(data != NULL) { - *data = NULL; - } - - ASSERT(self != NULL, RET_ERR(PM_ERR_WRONG_ARGS, false)); - return self->remove(ptr, fn, data); -} - void *f_ptrlistitem_data(const FPtrListIterator *self) { ASSERT(self != NULL, RET_ERR(PM_ERR_WRONG_ARGS, NULL)); diff --git a/lib/libpacman/util/fptrlist.h b/lib/libpacman/util/fptrlist.h index ef95ab9..a43261b 100644 --- a/lib/libpacman/util/fptrlist.h +++ b/lib/libpacman/util/fptrlist.h @@ -41,9 +41,6 @@ extern "C" { #define FREELIST(p) do { if(p) { f_ptrlist_delete(p); p = NULL; } } while(0) -FPtrList *f_ptrlist_add_sorted(FPtrList *list, void *data, _pacman_fn_cmp fn); -bool _pacman_list_remove(FPtrList *haystack, void *needle, _pacman_fn_cmp fn, void **data); - typedef void (*FPtrListIteratorVisitorFunc)(FPtrListIterator *item, void *visitor_data); void *f_ptrlistitem_data(const FPtrListIterator *self); _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
