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:
parent
0c43198ee0
commit
f4992960ad
1 changed files with 3 additions and 8 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Reference in a new issue