From f4992960ad4a325184802a47dc23d53d15be452f Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Fri, 1 Aug 2014 14:19:48 -0700 Subject: deps.c: use alpm_list_find_ptr Signed-off-by: Andrew Gregory Signed-off-by: Allan McRae --- lib/libalpm/deps.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index adbccd1e..c5acfc95 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -90,11 +90,6 @@ static alpm_pkg_t *find_dep_satisfier(alpm_list_t *pkgs, alpm_depend_t *dep) return NULL; } -static int ptr_cmp(const void *p, const void *q) -{ - return (p != q); -} - /* Convert a list of alpm_pkg_t * to a graph structure, * with a edge for each dependency. * Returns a list of vertices (one vertex = one package) @@ -201,14 +196,14 @@ alpm_list_t *_alpm_sortbydeps(alpm_handle_t *handle, /* child is an ancestor of vertex */ alpm_graph_t *transvertex = vertex; - if(!alpm_list_find(targets, nextchild->data, ptr_cmp)) { + if(!alpm_list_find_ptr(targets, nextchild->data)) { /* child is not part of the transaction, not a problem */ continue; } /* find the nearest parent that's part of the transaction */ while(transvertex) { - if(alpm_list_find(targets, transvertex->data, ptr_cmp)) { + if(alpm_list_find_ptr(targets, transvertex->data)) { break; } transvertex = transvertex->parent; @@ -234,7 +229,7 @@ alpm_list_t *_alpm_sortbydeps(alpm_handle_t *handle, } } if(!found) { - if(alpm_list_find(targets, vertex->data, ptr_cmp)) { + if(alpm_list_find_ptr(targets, vertex->data)) { newtargs = alpm_list_add(newtargs, vertex->data); } /* mark that we've left this vertex */ -- cgit v1.2.3-70-g09d2