deps.c: use alpm_list_find_ptr

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Andrew Gregory 2014-08-01 14:19:48 -07:00 committed by Allan McRae
parent 0c43198ee0
commit f4992960ad

View file

@ -90,11 +90,6 @@ static alpm_pkg_t *find_dep_satisfier(alpm_list_t *pkgs, alpm_depend_t *dep)
return NULL; 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, /* Convert a list of alpm_pkg_t * to a graph structure,
* with a edge for each dependency. * with a edge for each dependency.
* Returns a list of vertices (one vertex = one package) * 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 */ /* child is an ancestor of vertex */
alpm_graph_t *transvertex = 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 */ /* child is not part of the transaction, not a problem */
continue; continue;
} }
/* find the nearest parent that's part of the transaction */ /* find the nearest parent that's part of the transaction */
while(transvertex) { while(transvertex) {
if(alpm_list_find(targets, transvertex->data, ptr_cmp)) { if(alpm_list_find_ptr(targets, transvertex->data)) {
break; break;
} }
transvertex = transvertex->parent; transvertex = transvertex->parent;
@ -234,7 +229,7 @@ alpm_list_t *_alpm_sortbydeps(alpm_handle_t *handle,
} }
} }
if(!found) { 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); newtargs = alpm_list_add(newtargs, vertex->data);
} }
/* mark that we've left this vertex */ /* mark that we've left this vertex */